Consulting

Results 1 to 2 of 2

Thread: How to reuse existing connection to database

  1. #1
    VBAX Newbie
    Joined
    Apr 2013
    Posts
    1
    Location

    Lightbulb How to reuse existing connection to database

    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

  2. #2
    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?
    Boyd Trimmell aka HiTechCoach
    Microsoft Access MVP -2010-2015

    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •