标签:io os 使用 ar for 数据 cti on c
服务端使用FDQUERY查询数据并返回TDATASET:
function TServerMethods1.GetData(var sql: string): tdataset;
begin
qry.Close;
qry.Open(sql);
Result := TFDMemTable.Create(nil);
TFDMemTable(Result).Data := qry.Data;
end;
客户端用FDCONNECTION连接中间件,FDStoredProc访问远程方法:
procedure TForm1.Button1Click(Sender: TObject);
begin
FDConnection1.Connected := true;
FDStoredProc1.Close;
FDStoredProc1.Unprepare;
FDStoredProc1.StoredProcName := ‘TServerMethods1.GetData‘;
FDStoredProc1.Prepare;
FDStoredProc1.ParamByName(‘sql‘).Value := ‘select * from bas_goods‘;
FDStoredProc1.open;
FDMemTable1.Close;
FDMemTable1.Data := FDStoredProc1.Data;
FDStoredProc1.Close;
end;
标签:io os 使用 ar for 数据 cti on c
原文地址:http://www.cnblogs.com/hnxxcxg/p/3973864.html