unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, DB, DBClient, MConnect, StdCtrls, SConnect;

type
  TForm1 = class(TForm)
    DCOMConnection1: TDCOMConnection;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Button2: TButton;
    memo1: TMemo;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  label2.Caption:=IntToStr(dcomconnection1.AppServer.clientcount);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  DComConnection1.AppServer.newQuery(memo1.Lines.text);
  ClientDataSet1.close;
  ClientDataSet1.Open;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  // 把Memo1内用户输入的SQL命令传给应用程序服务器，
  //通过DataSetProvide对远程数据模块的数据集进行查询。
  ClientDataSet1.Close;
  ClientDataSet1.CommandText := Memo1.Lines.Text;
  ClientDataSet1.Open;
end;

end.
