Access database common problem handling

Published: 2004-03-20

1. When opening the website, it keeps loading until timeout, or prompts that the database connection failed:
This usually occurs when the database is locked. Check whether .ldb files exist in the directory the website uses to call the database (generally the program uses the on error resume next statement; note). Solutions:
(1) Restart the process pool. If it occurs frequently, it is recommended to contact the program provider or developer for debugging and optimization, or change to an mssql database; if it occurs occasionally, restart the process pool/change the application pool.
(2) Some website code itself has problems, causing the database to lock up as soon as it is accessed. The solution is to contact the program developer to repair or optimize the database, or change to an mssql database.
Method for repairing the acc database:

xiufu.jpg


2. The “microsoft.jet.oledb.4.0” provider is not registered on the local computer, orthe provider cannot be found. The program may not be installed correctly.

This is because the Win2008system we use is 64-bit, whereas the previous Win2003was 32-bit. There are the following two solutions:

     1. Modify the code for connecting to the database:
For example, the original code is
DataPath = "App_Data/#data.mdb"; 
String constring = "provider=microsoft.jet.oledb.4.0;data source=" + HttpContext.Current.Server.MapPath(DataPath) + "";
The modified code is:
DataPath = "App_Data/#data.mdb";
string constring = "provider=Microsoft.ACE.OLEDB.12.0;data source=" + HttpContext.Current.Server.MapPath(DataPath) + "";
Note: only the part in red font needs to be modified; do not modify the rest. In other words, switch to another driver for connecting to the database
.


2.  In our backend, change to 32-bit compatibility mode:

Log in to our website backend and enter the management center Business ManagementàVirtual Host ManagementàManageàProgram Compatibility Mode

201282211161355392.gif

3. File not found 

Microsoft JET Database Engine error '80004005' File not found  'd:\wwwroot\xxxx\wwwroot\2.MDB'

   This situation is generally caused by an incorrect path / inconsistency between the database name and the setting in the program, etc.; just modify it.


4. Unrecognized database format 'd:\wwwroot\szrxdg\wwwroot\App_Data\hmxdata.mdb'.

    It is generally caused by an incomplete upload of the database file, a corrupted file, etc.; just re-upload it.


5. Cannot open registry key

   Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

   [Microsoft][ODBC Microsoft Access Driver] Common error Cannot open registry key 'Temporary (volatile)  Jet DSN for process 0x1844 Thread 0x1b40 DBC 0x554cc59c Jet'.
 
  This is caused by a database connection failure. First, check whether the path for connecting to the database in conn.asp is correct, and check whether the database actually exists. If the database already exists and there is no error in the path in the connection program, please re-upload the local access database once.

  If the database on the server is the latest and cannot be resolved by re-uploading, please download the database on the server to your local computer, open your database with access2000, then use Repair Database in Tools, repair it once and re-upload it.

  In addition, if it is a server, check whether the temporary directory permissions are set too low; just add everyone.