FMS Site Search

Microsoft Access Error 3045 (Could Not Use Database; File Already in Use) May Not be Due to an Exclusive Lock

Error Message

When you try to open a database, you may encounter this error message:

Could not use [Database Name]; file already in use.

Basic Explanation

This error occurs if another user (or instance of
Access) has opened up the database exclusively and
you try to open it. Maybe the other user opened the
database in exclusive mode or made some
modifications such as editing modules, which put the
database in exclusive mode.

However, that may not be the case. This error can
occur even if the other user has the database opened
without opening it exclusively. What's going on? Why
would the second instance think it's being opened
exclusively?

What if the Other User Isn't Opening it Exclusively?

It turns out that there may be other causes that are
not obvious and related to workgroup
security files. This applies to MDB files (not ADP
or ACCDB formats).

If two instances of Microsoft
Access (DAO database engine) are using different
system MDW files, a conflict may occur where the
database appears to be exclusively locked by the
other instance. The MDW file used by your instance
of Access can be checked in VBA by examining the
value of DBEngine.SystemDB.

Another copy of Access or DAO may have that
database opened using another MDW file causing this
conflict. This can come from another instance of MS
Access, a Microsoft Access add-in or library
reference, a VBA Add-in, or other program such as
VB6, .NET, etc. that's connecting to that database.

To avoid this, if you’re using workgroup
security, make sure every instance is pointing to
the same shared MDW file. This is often defined in
the shortcut used to launch Microsoft Access, or if
you are opening a different database
programmatically within your VBA code.

Old Access 97 Version of the MDW File

If you're running Access 2000 or later, you may still be using an MDW file in Access 97 format which can cause problems. Access 2000 introduced a new Access MDB format.

Though later Access
versions can still open Access 97 databases, they want to convert them. To address this:

Make a backup of your MDW file.

Try to open the MDW database in Access. It's an Access MDB database with a different extension.

If it's in 97 format, Access will prompt you to convert it to the current MDB format.

After converting it, use the new MDW as your workgroup security file.

Additional Resources

If you're interested in seeing who's going in and
out of your database in real time, check out our
Total Access Admin program. It'll let you monitor multiple databases across your network to
see when users enter and exit your database and flag instances where connections are dropped
suspiciously. Free Trial.