Link to home
Start Free TrialLog in
Avatar of ccmak76
ccmak76

asked on

How to get connection handle of ADODB.connection

There is an existing program (written in VB 6) accesses a database through ODBC using ADO. Is there any way to get the connection handle of the ADODB.Connection object so that it can be passed to a DLL written in C++ to access same database using the same connection?
Avatar of rpai
rpai

Can you not pass the entire connection string to the DLL in C++ instead of the handle ?
In your DLL export a function that accepts a long value (or whatever the C++ vb compliant type is) and then use the addressof keyword in the function call to send the address of your adodb.connection object

x = EnumWindows(AddressOf MyConn)


Honestly I am shooting from the hip here. Lemme know if this works. Cool question ;)


Dont forget to declare your exported function in your module (Im sure you already know that)
ASKER CERTIFIED SOLUTION
Avatar of ariell
ariell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
Hi ccmak76,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept ariell's comment(s) as an answer.

ccmak76, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange