ERROR

Failed to connect to database. Cannot acquire a schema lock because of an existing lock

Last Published: April 25, 2020

Error Message

When using UNC pathnames to access data in a personal geodatabase opened by another user or application, the following error message may be encountered:

"Failed to connect to database."
"Cannot acquire a schema lock because of an existing lock."
"Could not use <filename>; file already in use."

Trying to open the MDB file through a UNC path in Microsoft Access raises a similar error:

"Could not lock file. (Error 3050)"

Cause

This error may occur due to any number of actions or workflows in ArcGIS; all of which involve opening the personal geodatabase when the following conditions are met:
- The personal geodatabase is already open.
- A UNC path is used to access the data in the personal geodatabase during the connection that is raising the error.
- The correct Sharing privileges are not granted on the folder containing the personal geodatabase.

When these three conditions are met, the operating system does not allow the Microsoft Jet Engine to create an .ldb file to lock the MDB file for access, which causes the error to be raised.

Solution or Workaround

This error can be avoided by closing all other applications accessing the personal geodatabase, or by not using UNC paths to access the personal geodatabase.

If it is not possible to use one of these solutions to avoid the error, the only remaining option is to modify the privileges of the folder containing the MDB file. To obtain a lock on the MDB file, write privileges need to be granted on the folder in which the MDB file is contained. To assign the correct privileges, follow the steps below.

  1. Open the Sharing and Security dialog box for the folder and select the Sharing tab.
  2. Click the Permissions command to open the Permissions dialog box.
  3. Make sure the user trying to open the MDB file has Change or Full permissions on the folder.
  4. If these steps do not work, consult the operating system or network documentation on how to properly assign write privileges to the folder.

Article ID:000010015

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic