MS Access - You Do Not Have Exclusive Access to the database

Anonymous
2014-04-02T09:38:39+00:00

I frequently receive the error message "You do not have exclusive access to the database at this time. If you proceed to make changes, you may not be able to save them later"

My database is a split database running on a standalone laptop therefore there cannot be another user and I only have one instance of the database open.

Laptop is running XP although I have transferred the database to a Windows 7 desktop and got the same results.

I have run compact and repair

Database files and security file all have different names

I have imported all the objects into a new database

All to no avail

When I start the database and check the ldb file the only user shown is the one I am logged in as however when I receive the error message 'Admin' user is also shown in the ldb.

Also interestingly in the VBA immediate window

?CurrentUser returns 'Developer' which is the name I am logged in as but

?DBEngine.Workspace(0).UserName returns 'Admin'

Any help or suggestions would be greatly appreciated

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2014-04-06T11:20:27+00:00

    Any ideas on how to solve this problem would be greatly appreciated.

    0 comments No comments
  2. Anonymous
    2014-04-06T13:38:01+00:00

    Sounds like a Recordset is being left open when you close.  Do this, log out of your database and close Acceess.  Bring up the Task Manager... is there still an instance of MSACCESS.EXE running?  If yes, then check your code for the unclosed Recordset.

    4 people found this answer helpful.
    0 comments No comments
  3. Tom van Stiphout 40,086 Reputation points MVP Volunteer Moderator
    2014-04-06T23:44:25+00:00

    In addition to what Gina suggested: run Access in Exclusive mode. Create a shortcut like this:

    [path_to]\msaccess.exe [path_to]\your.mdb /wrkgrp [path_to]\your.mdw /user youruser /password yourpassword /exclusive

    Details: http://support.microsoft.com/kb/209207

    If you run in exclusive mode, it will generate an error if your app tries to do something unusual that would cause this second instance. You can then debug from there.

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2014-04-07T14:10:23+00:00

    Gina and Tom, many thanks for your advice it started me down a new line of investigation.

    The offending line of code was in a form that opened at startup and was

    DAO.DBEngine.SetOption dbMaxLocksPerFile, 100000

    When I removed this line the problem went away.

    Now I just need to work out why the line of code was there in the first place and the impact of removing it.

    2 people found this answer helpful.
    0 comments No comments