Page 1 of 1

Handle of ADO connection

Posted: Mon 03 Dec 2007 12:02
by Lisichkin
Hi, I’m using SDAC 3.55.2.22, developer license number is CRSDA-01427.

In SDAC examples (Sdac\Demos\Dll) parameter TMSConnection passed as object

Code: Select all

procedure AssignConnection(MSConnection: TMSConnection); cdecl;
So, it is not possible of using this dll in project compiling in different languages (such as c#). And much more in this case we should have BORLNDMM.DLL.
How we can pass handle of ADO connection (or interface), as it did it in ADO?

Code: Select all

TADOConnection.ConnectionObject
_Connection = ADOInt._Connection;

Posted: Wed 05 Dec 2007 09:26
by Antaeus
SDAC does not provide such functionality.

Posted: Thu 06 Dec 2007 12:36
by Lisichkin
Can we pass in to dll instead of object TMSConnection, OLE DB interface’s?
So we keep @@SPID and in dll project do not create new connection to MS SQL.

Code: Select all

TMSHack=class(TMSConnection)
TOLEDBHack=class(TOLEDBConnection)

ExternalMS: TMSConnection;

TOLEDBHack(TMSHack(ExternalMS).FIConnection).FIDBInitialize := rIDBInitialize
TOLEDBHack(TMSHack(ExternalMS).FIConnection).FIDBProperties := rIDBProperties
TOLEDBHack(TMSHack(ExternalMS).FIConnection).FIDBCreateSession := rIDBCreateSession
TOLEDBHack(TMSHack(ExternalMS).FIConnection).FISessionProperties := rISessionProperties
TOLEDBHack(TMSHack(ExternalMS).FIConnection).FITransactionLocal := rITransactionLocal
Is this code error safe?

Posted: Tue 11 Dec 2007 10:43
by Antaeus
This code uses internal objects of SDAC. So we can not guarantee that it will be compatible with future versions of SDAC, therefore we do not recommend using the code.
We also did not check this code for the current SDAC, so if you insist on going the hack way, you should carefully test it before using it in a production applications.
We will consider possibility to implement such functionality in the future builds\versions of SDAC.