SoFunction
Updated on 2025-04-09

Access cannot open registry keyword error handling method (80004005 error)

The error message is as follows:
----------------------------------
Microsoft OLE DB Provider for ODBC Drivers Error ''''80004005''''
[Microsoft][ODBC Microsoft Access Driver] Common Errors Cannot open the registry keyword ''''Temporary (volatile) Jet DSN for process 0x728 Thread 0x854 DBC 0x276fb44 Jet''''.
----------------------------------

The following possible reasons:
1. Microsoft has no longer updated ODBC, so it needs to use JET to connect to ACCESS database files;
2. Changes in permissions of the system directory.
There are also old posts saying that the reason is: "The ACCESS database file is ACCESS97 version". This does not need to be considered. I am using ACCESS2000 database.

For the first reason, the original connection string is as follows:
--ODBC connection method ------------------------------------
mdbpath=("")
CnnStr = "DBQ=" & mdbpath & ";DRIVER={Microsoft Access Driver (*.mdb)};uid=admin;pwd="
-------------------------------------

The connection string is:
---JET connection method --------------------------------------------------------------------------------------------------------------------------
CnnStr = "Provider=.4.0;User Id=admin;Data Source="& mdbpath &" '''';Password=luntanbbs"
-------------------------------------

The test was invalid, although the error message prompted was a little different:
----------------------------------
Microsoft JET Database Engine Error ''''80004005'''' Unspecified Error
----------------------------------

Finally, check the second reason: insufficient permissions for the system directory. After inquiry, it turned out that due to security reasons, a colleague set the WINNT directory of the server to "full control" and the system, and users are read-only.
However, logically speaking, the ODBC driver is also readable with such permission settings. Is it because of the lack of "execution" permission?
I granted "execution" permissions to all DLL files starting with odbc in the winntsystem32 directory, but found that the same error message was still the same. Then I simply set the entire system32 directory to be executable by everyone, but it still didn't work after the test.
Is there any other file that is called by ODBC or JET but is not in this system32 directory and is not fully authorized, resulting in failure?
While thinking about it, I suddenly saw the winnttemp directory. Hey, I set the temp directory to everyone to "write" and see.

Once the test, hey, it's done. The program using ODBC connection method successfully reads and updates records in the ACCESS database.