FireDAC.Comp.Client.TFDCustomConnection.CliHandle

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

property CliHandle: Pointer read GetCliHandle;

C++

__property void * CliHandle = {read=GetCliHandle};

Propriétés

Type Visibilité  Source Unité  Parent
property public
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDCustomConnection


Description

Handle CLI pour le partage des connexions.

La propriété CliHandle renvoie un handle de connexion d'interface de niveau d'appel SGBD. Cette valeur peut être assignée à la propriété SharedCliHandle d'un autre objet TFDCustomConnection. Cela est utile pour transférer une connexion d'une application dans une DLL. Voir Développement de DLL

Après la définition de Connected sur True pour la connexion DLL, les deux connexions partageront la même connexion SGBD physique. Cette connexion doit être fermée après toutes les autres connexions qui partagent le même handle CLI.

Exemple

//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;

Voir aussi