I want to use connection object of client application in the dll

rahultalele
rahultalele used Ask the Experts™
on
I have a client application made in visual basic which connects to sql database and retrives the data. Now i want to create a dll of one of the public fuctions i have used in that application. The function uses the recordset to retrive itemcode. annd the function is passed with barcode. Now since in the vb application i have written the code to connectthe datbase first i need not write it again in the class module. No i want to use the same connection object which i have created in my application for my dll to use to retrive the record.

Regards
Rahul
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Consultant
Top Expert 2016
Commented:
In your DLL, you will need to have a public property or variable in a Public class like this:

Public gcnDB as adodb.connection

In your EXE, you will need to have a instance of this class and set the connection this way:

dim x as new ClassName

set x.gcnDB = YourConnection
Author of the Year 2009

Commented:
Hi rahultalele,
It appears that you have forgotten to close 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 's comment(s) as an answer.

rahultalele, 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.
==========
DanRollins -- EE database cleanup volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial