Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Multiple modules, single connection
Multiple modules, single connection
Posted: 2003/06/02 13:12
 
Is there a way to pass connection context from on TOCIDatabase to another one in another module? I have an app which will grow to have more than 50 dll-s, so connect by each one is unacceptable. BDE has Handle property that can be passed, but OCIDatabase has nothing similar...
RE: Multiple modules, single connection
Posted: 2003/06/04 17:16
 
Hello !

Unit NCOciDB.pas has class TOCIImpHndlDatabase. It is for your task <g> It has following public properties:

property hImpTX;
property hImpSes;
property hImpSrv;
property hImpSvc;
property hImpEnv;
property hImpErr;

You can have one TOCIDatabase, which will really maintain connection. And TOCIDatabase has public properties:

property HTransaction;
property HSession;
property HServer;
property HService;
property HEnvironment;
property HError;

So, assign corresponding properties of TOCIDatabase to TOCIImpHndlDatabase before to connect last one. Then set TOCIImpHndlDatabase.Connected := True.

I think, it will work. But all that was not tested for DLL.

Regards,
Dmitry