ServerDataModule.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- Unit serverdatamodule;
- interface
- uses
- SysUtils, Classes, InvokeRegistry, Midas, SOAPMidas, SoapDm, Provider,
- DB, DBTables, DBXpress, FMTBcd, SqlExpr;
- type
- ISoapTestDm = interface(IAppServer)
- ['{1F109687-6D8B-4F85-9BF5-EFFC87A9F10F}']
- function GetRecordCount: Integer;
- end;
- TSoapTestDm = class(TSoapDataModule, ISoapTestDm, IAppServer)
- DataSetProvider1: TDataSetProvider;
- SQLConnection1: TSQLConnection;
- SQLDataSet1: TSQLDataSet;
- SQLDataSet2: TSQLDataSet;
- private
- public
- function GetRecordCount: Integer;
- end;
- implementation
- {$R *.DFM}
- procedure TSoapTestDmCreateInstance(out obj: TObject);
- begin
- obj := TSoapTestDm.Create(nil);
- end;
- { TSoapTestDm }
- function TSoapTestDm.GetRecordCount: Integer;
- begin
- // read in the record count by running a query
- SQLDataSet2.Open;
- Result := SQLDataSet2.Fields[0].AsInteger;
- SQLDataSet2.Close;
- end;
- initialization
- InvRegistry.RegisterInvokableClass(TSoapTestDm, TSoapTestDmCreateInstance);
- InvRegistry.RegisterInterface(TypeInfo(ISoapTestDm));
- end.