ucorbadmdiiserver.pas
来自「delphi多层应用系统 delphi多层应用系统」· PAS 代码 · 共 59 行
PAS
59 行
unit ucorbadmDIIServer;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComObj, VCLCom, StdVcl, DataBkr, CorbaRdm, CorbaObj,
PDIIServer_TLB, Provider, Db, DBTables;
type
TCORBADIIServer = class(TCorbaDataModule, ICORBADIIServer)
Session1: TSession;
Database1: TDatabase;
Query1: TQuery;
quryEmployees: TQuery;
DataSetProvider1: TDataSetProvider;
private
{ Private declarations }
public
{ Public declarations }
protected
function Employees: OleVariant; safecall;
end;
var
CORBADIIServer: TCORBADIIServer;
implementation
{$R *.DFM}
uses CorbInit, CorbaVcl;
function TCORBADIIServer.Employees: OleVariant;
var
iCount : Integer;
begin
try
quryEmployees.Close;
quryEmployees.Open;
Result := VarArrayCreate([0, quryEmployees.RecordCount - 1], varVariant);
iCount := 0;
while not quryEmployees.Eof do
begin
Result[iCount] := quryEmployees.Fields[0].Value;
Inc(iCount);
quryEmployees.Next;
end;
finally
quryEmployees.Close;
end;
end;
initialization
TCorbaVclComponentFactory.Create('CORBADIIServerFactory', 'CORBADIIServer', 'IDL:PDIIServer/CORBADIIServerFactory:1.0', ICORBADIIServer,
TCORBADIIServer, iMultiInstance, tmSingleThread);
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?