Access lock file does not get closed/removed.

bfuchs
bfuchs used Ask the Experts™
on
Hi Experts,
I have my Access backend database on the server and some times nobody is using it, I can go into design of each of the tables.
However the lock file does not get closed after closing all Access instances.
Is it safe to copy over the file to a different location, compact it and place it back in the original location?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Bharat BhushanSolution Manager

Commented:
If you are sure no one is using it.  It should be noted that file remaining in place means someone does not have the proper permissions to the folder where the Back-end resides.
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
Yes, that is safe. But also delete the lock file.

And try to find out which workstation is leaving the lock file. It should be deleted when the last user signs out.
Jim Dettman (EE MVE)President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012

Commented:
I would add that it being left behind doesn't really hurt anything.    Way back when, the .LDB was never deleted.

   They (Microsoft) made the change to help with certain login situations (mostly on Novell servers).  The other reason is that if your reading the .LDB file directly, you'll often see some "phantom" users in it.

   They are truly not because it is the corresponding user lock that determines if a user is active in the DB or not and the slot in the .LDB is "active".   By deleting the file, these get cleaned up.

  Last, one case where you will see a .LDB left behind is if the database is flagged corrupt (prompts for repair).   The .LDB is left behind so that the station that set the flag can be determined.

Jim.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Hi Experts,

Just returning from weekend vacation...

And try to find out which workstation is leaving the lock file.

The .LDB is left behind so that the station that set the flag can be determined.

So what is out there to help find out which users have this lock file open?

When I look at the servers managing open files, nothing is listed there...

FYI- The BE file is Access 2003 format, and FE by most users is A2007.

Thanks,
Ben
Bharat BhushanSolution Manager

Commented:
Yes, that is safe. But also delete the lock file.

And try to find out which workstation is leaving the lock file. It should be deleted when the last user signs out.

It should be and, if you have all the right permissions then maybe recreate the profile, it might have gone bad.
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
So what is out there to help find out which users have this lock file open?

There is the old LDBView Utility which works for mdb files only.

It can be hard to locate, so I have attached a copy. Rename it to .exe
LDBView.ex_
President / Owner
Most Valuable Expert 2017
Most Valuable Expert 2012
Commented:
<<So what is out there to help find out which users have this lock file open?>>

 If you cannot delete the .LDB/.LACCDB, then there is a handle open in the OS.   If it's opened over the network, you will see it open in the server manage files.   However if it's opened on the server, then you would need to use Process Explorer:

https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer

 To find the file handle and close it.   This is how you can get rid of a .LDB file that you cannot delete without rebooting the server.  There are a few freeware utilities out there floating around that make it simpler, but that's the jist of it (closing the file handle).

<<FYI- The BE file is Access 2003 format, and FE by most users is A2007.>>

  Keep in mind that the lock file is associated with the DB....so if there is a FE/BE, there will be one for each.   gustav posted the old LDB View utility.   It has not been updated for A2007 and up.   Instead, you would need to use the JET SHOW USER ROSTER funtion:

https://support.microsoft.com/en-us/help/285822/how-to-determine-who-is-logged-on-to-a-database-by-using-microsoft-jet

and there are plenty of utilities floating around based on that:

https://www.access-programmers.co.uk/forums/showpost.php?p=1544570&postcount=2

This one includes the "Suspect State" flag (the corrupt flag).   It also shows the "Connected" status.

Ones that are listed "Yes" have an active user lock and are connected to the DB.

Ones that are listed "No" can be the "phantom" users I was talking about earlier if the lock file is not routinely deleted.    This is a user where a machine/username is still in the file, but there is no active user lock in the OS.

Jim.
Thank you my experts.
Bharat BhushanSolution Manager

Commented:
Thank you my experts.

Most welcome!

Regards,
Bharat

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial