应用服务器:
function Txuhuizhe.AddSQL(ClearFlag: WordBool;
const SqlString: WideString;
ExecFlag: WordBool): WordBool;
begin
with self.ADOQuery1do
try
active:=false;
if ClearFlag then
Sql.Clear;
Sql.Add(SqlString);
if ExecFlag then
execsql;
result:=true;
except
result:=false;
end;
end;
客户端:
procedure TForm1.Button1Click(Sender: TObject);
begin
if ClientDataSet1.Active then
ClientDataSet1.Close;
DCOMConnection1.AppServer.Addsql(true,'select * from jxc_base_Client',false);
ClientDataSet1.open;
end;