Access error reference
Access error 3051: file already opened exclusively or no access
The Access database no longer opens, or its linked tables refuse to show: the engine cannot open the file. Someone opened it in exclusive mode, or the Windows account lacks the permissions it needs on the file or its folder.
The message

The Microsoft Access database engine cannot open or write to the file '…'. It is already opened exclusively by another user, or you need permission to view and write its data.
On a French Access: « Le moteur de la base de données Microsoft Access ne peut pas ouvrir ou écrire sur le fichier « … ». Il est déjà ouvert en mode exclusif par un autre utilisateur, ou vous devez avoir l’autorisation de visualiser et d’écrire sur ses données. »
Microsoft gives two causes: you need permission to read the file's data, or you tried to open it exclusively while another user already has it open.
Where it shows up
When opening the database, at the first linked table read at start-up, or in code: OpenDatabase, RefreshLink, TransferDatabase, copying or compacting the back end.
Common causes
- a user opened the database in exclusive mode, often to compact or change it;
- the shared folder's permissions: read-only, or no right to create and delete the lock file (.laccdb or .ldb);
- a process holds the file: a backup, an antivirus, OneDrive or SharePoint sync, an Access session left open in the background;
- the “Open in exclusive mode” option set as default in a PC's Access options.
How to reproduce and check it
- Check whether a .laccdb (or .ldb) file sits next to the database: it signals an open session.
- Ask who has the database open; on the server, the share's open files list also tells you.
- Check with the user's account that they can create a file in the database's folder, and delete it.
How to fix it
Have the exclusive session closed, and untick exclusive mode in the PC's options (Access Options, Client Settings, default open mode “Shared”). Give users read, write, create and delete permissions on the folder, not just on the file.
In code, open the back end in shared mode: Set db = DBEngine.OpenDatabase(strPath, False, False) (second argument False: not exclusive; third False: not read-only). Move the database out of synced folders (OneDrive, SharePoint).
What Auscult reports
Auscult only runs the database on a copy. If one of the application's databases cannot be copied because it is open on another PC, or because the Windows account has no right to read it, the analysis runs nothing and says so. The report then advises closing the application on the other PCs, checking that the database opens from this PC, and running the analysis again.
Related errors
- 3027 — database or object is read-only, when the file opens but without write permission
- 3218 — could not update; currently locked
- The Access error reference, code by code