mdb file still locked after closing the OleDbconnection.

S

Sagaert Johan

Hi

I have a problem with an mdb file still being locked after i closed the
OleDBConnection. (can't rename or delete the file)

Is there anything that still has some open filehandle to the mdb ?


I noticed when i wait a few seconds ( loop containing
Application.Doevents() )
after i called the close methed then ,the mdb file seems to get unlocked..

Are some background oledb processes causing this locking ?

How can i check on this or is there another reason ?

Johan
 
R

rakesh_nits

Hi Sagaret,
May be you can try the Handle freeware on Sysinternals.com and store
the output in a text file , it will show which process is still using
it..Hope it helps.
Rakesh
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Sagaert,

Keep im mind that when something calls close on a file handle the close
request is put in a queue to be processed by the kernel. In other word even
closing a simple file doesn't happen instantly. This is the behaviour of all
modern OS AFAIK.

What I'm trying to say is that you shouldn't rely on the time when a file is
going to be closed, unlocked, etc.
 

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