FireDAC.Comp.Client.TFDCustomConnection.CliHandle

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCustomConnection

Delphi

property CliHandle: Pointer read GetCliHandle;

C++

__property void * CliHandle = {read=GetCliHandle};

Description

CLI handle for connection sharing.

The CliHandle property returns a DBMS Call Level Interface connection handle. This value can be assigned to another SharedCliHandle property of an TFDCustomConnection object. This is useful to transfer a connection from an application into a DLL. See DLL Development

After setting Connected to True for the DLL connection, both connections will share the same physical DBMS connection. This connection must be closed after all other connections that share the same CLI handle.

Example

//Application code (without checks):
FhDll := LoadLibrary(PChar('Project2.dll'));
@FpShowData := GetProcAddress(FhDll, PChar('ShowData'));
FpShowData(FDConnection1.CliHandle);

//DLL code:
procedure ShowData(ACliHandle: LongWord);
begin
  FDConnection1.SharedCliHandle := ACliHandle;
  FDConnection1.Connected := True;
  FDQuery1.Active := True;
end;

See Also