"General error Unable to open registry key Temporary (volatile) ..." from Access ODBC

Causes

General error Unable to open registry key Temporary (volatile) Ace DSN for process ...

This is the top-level error message produced by the Access Database Engine (a.k.a. "ACE") ODBC driver when the current process is unable to open the Access database file for one of the following reasons:

  1. Some other process has opened the database "exclusively".

  2. Some other process originally opened the database file in Access as "shared" and has some pending structural modification that requires "exclusive" access to the file. Examples of such pending modifications are edits to Module code that have not yet been saved, or having a Form or Report open in Design View.

  3. The account under which the current process is running does not have sufficient filesystem permissions to open the database file or the folder in which it resides.

  4. The account under which the current process is running does not have sufficient registry permissions to access the values under the HKLM\SOFTWARE\ODBC key.

  5. The database file simply does not exist.

  6. The database you are trying to open requires a newer version of Microsoft Access.

When only the top-level error message is reported, the earlier "Jet" ODBC driver produced somewhat more intuitive error messages. When the other process had done an "Open Exclusive" on the file the error message was

Could not use '(unknown)'; file already in use.

and when the file had pending design changes the error message said

The database has been placed in a state by an unknown user that prevents it from being opened or locked.

However, when we only see the top-level message produced by the ACE ODBC driver all we see is

General error Unable to open registry key Temporary (volatile) Ace DSN for process ...

That is because both drivers return multiple error messages, but they return them in a different order. The Jet messages are ...

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

ERROR [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xed4 Thread 0x1204 DBC 0xab004 Jet'.

ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

ERROR [01000] [Microsoft][ODBC Microsoft Access Driver]General Warning Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xed4 Thread 0x1204 DBC 0xab004 Jet'.

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

... while the ACE messages are:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key Temporary (volatile) Ace DSN for process 0xf6c Thread 0x1568 DBC 0x6347fec Jet'.

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked.

Solutions

Scenarios 1 and 2 (another process has an "exclusive" lock on the file):

Ensure that the database file is not opened by any other process – often that means just closing the Access application itself – and then re-try the ODBC operation from your external application. Rebooting your machine is one way to ensure that any other such processes have been terminated and have relinquished their claim to the database file.

Scenario 3 (insufficient file/folder permissions):

Either adjust the permissions or move the file to a location where the user can open the file. Placing the database file in the root folder of a drive is a common cause of this type of problem.

Scenario 4 (insufficient registry permissions):

Adjust the registry permissions to allow the account to access the HKLM\SOFTWARE\ODBC key. The most common cause in this case is that an IIS process is running under an account that does not have normal "user" privileges. In that case remember that you should not be using Access databases with IIS anyway.

Scenario 5 (database file does not exist):

Fix the connection string so that it contains a valid path to an existing file.

Scenario 6 (database file requires a newer version of Access):

Upgrade Microsoft Access or the Access Database Engine Redistributable (if available).


Cause 6 (otherwise not covered) Forgetting to change the filename you're trying to open, after you've changed the name of the file. i.e. trying to open a non-existent file.