【delphi开源代码栏目提醒】:以下是网学会员为您推荐的delphi开源代码-AppServer.pas,希望本篇文章对您学习有所帮助。
unit AppServer;
interface
uses
ComObj, ActiveX, RServer_TLB, ADODB, ADODB_TLB;
type
TRDSAppServer = class(TAutoObject, IRDSAppServer)
protected
function Get_Employee: _Recordset; safecall;
end;
implementation
uses ComServ;
function TRDSAppServer.Get_Employee: _Recordset;
var
ConnStr: WideString;
begin
{ Create an ADO Recordset instance directly }
ConnStr := 'FILE NAME=' + DataLinkDir + '\DBDEMOS.UDL';
Result := CoRecordSet.Create;
Result.CursorLocation := adUseClient;
Result.Open('Employee', ConnStr, adOpenStatic, adLockBatchOpti
mistic, adCmdTable);
end;
initialization
TAutoObjectFactory.Create(ComServer, TRDSAppServer, Class_RDSAppServer,
ciMultiInstance, tmSingle);
end.