This article helps you identify and resolve issues where a Microsoft Access database file is locked, preventing users from opening or editing the file. This applies to customers using Microsoft Access as their primary database management tool.
Before you begin
You will need:
Access to the file server or storage location where the
.mdbor.accdbfile is hosted.Administrative or file-level permissions to manage file locks on the hosting server.
The specific file path of the locked database.
Troubleshooting file locks
If a user is unable to open a Microsoft Access database because the file is "locked for exclusive use" or "in use by another user," follow these steps to identify the source of the lock.
Check for active users
The most common cause of a file lock is an active connection from another user or an application.
Identify the users who may have the database open.
Ask those users to close the Microsoft Access application and any other software that might be connected to the database.
Wait 60 seconds for the system to release the file handle.
Attempt to open the database again.
Identify the process holding the file
If no users are actively using the database but the file remains locked, a background process or a "ghost" session may be holding the file open.
Log into the server where the database file is stored.
Open the Command Prompt as an Administrator.
Type the following command to see which processes are using the file:
openfiles /query | findstr "path_to_your_file"
Replace
path_to_your_filewith the actual path, such asC:\Databases\inventory.accdb.If a process is identified, note the Process ID (PID).
Use the Task Manager to identify the application associated with that PID and end the task.
Clear "zombie" sessions
Sometimes a network connection drops, but the server still believes the user is connected.
On the server, open the Resource Monitor (type
resmonin the Start menu).Go to the Network tab.
In the Associated Processes section, look for
msaccess.exe.If a process is hanging or appears to be from a disconnected user, right-click the process and select End Process.
Confirm the result
The database file is no longer reported as "in use" by the system.
Users can successfully open and edit the database.
The "File is locked" error message no longer appears.
Limitations
This procedure does not resolve issues caused by underlying file system corruption; if the file remains locked after all processes are closed, the file may need to be repaired using the Microsoft Access "Compact and Repair" utility.
Network latency can occasionally cause a delay in the release of a file lock after a user closes the application.
