closing connections in Access

E

Eric

I have a big project here that looks like a connection is being left
open. I've combed through the code for a long time now and wonder if there
are any general strategies anyone could recommend. I've used Visual
Studio's find in files feature to look for every instance of an open
connection and made sure that they were all closed. It seems when you go to
our shopping cart the Access makes it's .ldb file then it will never close.
The connection IS closed in the code though, and I'm out of ideas.
 
R

Rob

This is a known problem when accessing MDB files from ASP. If you're
using a shopping cart, you should definately use MSSQL due to
multi-user issues.

Search this forum, MS Support, and Google...I'm sure you'll find a
solution, workaround, or another person suggesting MSSQL.

I have a big project here that looks like a connection is being left
open. I've combed through the code for a long time now and wonder if there
are any general strategies anyone could recommend. I've used Visual
Studio's find in files feature to look for every instance of an open
connection and made sure that they were all closed. It seems when you go to
our shopping cart the Access makes it's .ldb file then it will never close.
The connection IS closed in the code though, and I'm out of ideas.

Please refrain from emailing me so the other
group members can gain from the info as well...
 
D

David Sceppa

Eric,

Is the application still running? Is it a Windows
application or a Web application?

It sounds like you're seeing connection pooling behavior.
By default, when you call Connection.Close(), the actual database
connection is pooled rather than closed. The connections will
time out of the pool after 60 seconds if they are not reused. If
the connection is still in the pool, the Jet engine will not
remove the .ldb file. If you want to disable connection pooling,
you could add "OLE DB Services=-4;" to your connection string.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2003 Microsoft Corporation. All rights reserved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top