home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Demos / Ado / Rds / appserver.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  750 b   |  33 lines

  1. unit AppServer;
  2.  
  3. interface
  4.  
  5. uses
  6.   ComObj, ActiveX, RServer_TLB, ADODB, ADODB_TLB;
  7.  
  8. type
  9.   TRDSAppServer = class(TAutoObject, IRDSAppServer)
  10.   protected
  11.     function Get_Employee: _Recordset; safecall;
  12.   end;
  13.  
  14. implementation
  15.  
  16. uses ComServ;
  17.  
  18. function TRDSAppServer.Get_Employee: _Recordset;
  19. var
  20.   ConnStr: WideString;
  21. begin
  22.   { Create an ADO Recordset instance directly }
  23.   ConnStr := 'FILE NAME=' + DataLinkDir + '\DBDEMOS.UDL';
  24.   Result := CoRecordSet.Create;
  25.   Result.CursorLocation := adUseClient;
  26.   Result.Open('Employee', ConnStr, adOpenStatic, adLockBatchOptimistic, adCmdTable);
  27. end;
  28.  
  29. initialization
  30.   TAutoObjectFactory.Create(ComServer, TRDSAppServer, Class_RDSAppServer,
  31.     ciMultiInstance, tmSingle);
  32. end.
  33.