Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I delete Lock file? Db.ldb

Status
Not open for further replies.

zollo9999

Programmer
May 12, 2002
95
AU
Hi

Can I delete a lock file when no-one is using it?
Do I need a windows administrator to do this?

Context
I have a master copy of my front end on the network and I give users a batch file which will make a copy from the network to their hard drive.

At some stage in my absence, the master has been opened and not properly closed.

Now there is a lock file Masterdb.ldb permanently open and I can't delete it.

Opening and closing the database, the lock file does not go away. The owner of the lock file does not have it open.
I opened the lock file and read the contents. It had my PC name in it (and I think another PC also, but I didn't take note of the Number. D'oh). I deleted all of the text and saved the file over the old one. Still can't delete the file.

This is not a problem unless, I want to compact the Masterdb an I can't get exclusive access to it.

I can get around this as I have another copy of the Master which I am developing and I can compact it and replace the Master on the network, but the lock file wont go away.

Any suggestions would be appreicated.
Thanks
Paul


Zollo A+ / VBA Developer
[thumbsup]
 
Thanks for your suggestion.

Actually, I just tried to edit the database and it would not let me. I closed the database and then the lock file was gone.!!!!

Any other tips about the lock files would be appreiciated.

Is it ok to open the lock file with notepad to see who has the file locked?

I have a list of PC names which correspond to users that I can use to find who has it open.

This would be helpful when trying to compact the backend and the backend has a lock file open.

thanks
Paul

Zollo A+ / VBA Developer
[thumbsup]
 
Hi

Assuming you have the "used" front end on each users PC local drive (as is the usual way to do it), the lock file associated with the front end will not tell you very much, since only one user will have it open at any one time. It is the loack file of the backend which is of interest.

The lock file should be created by Access (jet) automatically when the first user opens the mdb and should be deleted by Access (jet) when the last user closes the mdb. The lock file can be left intact if Access does not close properly, eg system crash etc, in which case you can delete it manually without risk of doing any harm.

If any user has the mdb open, then the .ldb will be "in use" and cannot be deleted, any attempy to do so, should give protection vilotation file in use message.

The content of the .ldb is fairly well documented if you do a search on google you should find enough to keep you busy for a while

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top