ADO with DLL problem 
Author Message
 ADO with DLL problem

Hello everyone,

    I hope someone can give me an answer to my problem.  I am using VC 5 and
ADO 1.5.  I have created a MFC shared library DLL.  I have everything
working, but when I call my function in the DLL, currently I do everything
in the function, creating the object, connecting to the database, creating
the recordset, etc.  However, I want to Create and open the connection to
the database and reuse that connection over and over again with different
calls.  I tried putting the CreateInstance and Open in various places, and
it fails.  Does anyone knows where to put the create and open so that I can
reuse that connection?  I have tried in the InitInstance, in a constructor
that is init at startup, in a separate function call but they all fail.

Thanks a million
Edwin



Fri, 15 Sep 2000 03:00:00 GMT  
 ADO with DLL problem

You might try making a pointer to a connection object a public member of
your DLL's application class. You can then call AfxGetApp() to get a pointer
to your application class from anywhere in your DLL code (and from there get
a pointer to your connection object).

In my DLL I created and exposed an "Initialize" function (which the exe can
call) that creates the connection object, assigns its address to the
connection ptr in my app class, and then calls open to open the connection.

Hope this helps,
Lyn

Hello everyone,

    I hope someone can give me an answer to my problem.  I am using VC 5 and
ADO 1.5.  I have created a MFC shared library DLL.  I have everything
working, but when I call my function in the DLL, currently I do everything
in the function, creating the object, connecting to the database, creating
the recordset, etc.  However, I want to Create and open the connection to
the database and reuse that connection over and over again with different
calls.  I tried putting the CreateInstance and Open in various places, and
it fails.  Does anyone knows where to put the create and open so that I can
reuse that connection?  I have tried in the InitInstance, in a constructor
that is init at startup, in a separate function call but they all fail.

Thanks a million
Edwin



Fri, 15 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problems with ADO in an MFC dll

2. ado and arx problems in MFC DLL.

3. |||||||| ADO : Problem with msado15.tlh file in MFC Extension DLL ||||||||

4. ado and arx problems in MFC DLL.

5. problems passing ADO Recordset from VB-COM client to VC-COM-Server dll

6. |||||||| ADO : problem with msado15.tlh file in MFC Exetension DLL ||||||||

7. Handling ADO exception in ATL dll

8. Getting warning C4251 when compiling a DLL containing ADO object

9. Passing ADO Recordset from ATL DLL to VB

10. Access Violation when ADO is used from global object exported from MFC extensions DLL (VC++)

11. ADO & DLL

12. ATL DLL and ADO

 

 
Powered by phpBB® Forum Software