Log in

View Full Version : How to reuse existing connection to database



speezie
04-26-2013, 10:50 AM
Hi Everyone,

We have a MS Access application which connects to a DB2 LUW database backend. It appears that whenever the database.OpenRecordset command is executed the application opens a new connection to DB2 to perform the query. Is it possible to just open one connection and reuse it? I believe the constant connect/disconnect is causing some overhead that I would like to avoid. I also noticed that even though I'm issuing the recordset.close and database.close commands the connection still remains to db2. Any help would be appreciated.

Thanks

HiTechCoach
04-29-2013, 12:19 PM
It would help to see a sample of your code.

Are you using ADO?
Where do you declare the database variable database?
Where do you set it? Is it global?