Wulin.com (www.vevb.com) In the process of writing WEB applications, we often have to deal with databases, such as the databases ACCESS, SQL SERVER, etc. that we often use daily. When connecting to these databases, the system often gives us some 80004005 errors like this. These various error messages are very troublesome. In order to facilitate netizens to solve such problems, this article will introduce and answer such problems in detail.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database
engine cannot open the file '(unknown)'. It is already opened exclusively
by another user, or you need permission to view its data.
[reason]
This error occurs when IIS uses an anonymous account (usually IUSR), which accesses the directory where the database is located in NT.
Does not have the correct permissions.
[Solution]
1. Check the permissions of files and directories. Ensure that Evryone has permissions to create and delete temporary files in the directory.
2. Check whether the data source file (DSN) is marked as being used by other programs. These programs are usually Visual InterDev. Close any project that is opening a database connection in InterDev.
3. Check whether a table in ACCESS is connected to a network server at this time.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access 97 Driver] Couldn't use '(unknown)'; file
already in use.
[reason]
To connect to the ACCESS database, it is being used and the database is locked, making it inaccessible.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified.
[reason]
The possible reason is that ConnectString initializes the Application connection string in global.asa, but the global.asa file does not work properly at this time.
[Solution]
Check whether the assignment is correct and add the following code to asp:
<%= 'auth_user' is & request.servervariables(auth_user)%>
<P>
<%= 'auth_type' is & request.servervariables(auth_type)%>
<P>
<%= connection string is & session(your_connectionstring)%>
<P>
Another reason is that spaces are added to ConnectString, for example
DSN = MyDSN; Database = Pubs;
Try changing it to something like this:
DSN=MyDSN;Database=Pubs;
If global.asa has not been run, check whether the file is in the root directory of the application or the root directory of the virtual directory.
It is also possible that the error occurs because the DSN name is not found. This can be solved by using the id=36767 method I provided. The last step is to check whether the latest driver is installed, that is, whether it is the latest MDAC version.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not ??
[reason]
This error may occur in the order of software installation (or uninstallation) on your computer. This error will occur if the ODBC versions are inconsistent.
[Solution]
The solution is to install the latest version of MDAC.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Access 97 ODBC driver Driver]General error Unable to open
registry key 'DriverId'.
[reason]
This error occurs when reading values from the registry. Use regedit32.exe to check the registry permissions.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][dbnmpntw]ConnectionOpen (CreateFile()).
[reason]
One reason: When a database contains permission relationships on different machines, this can also happen on the same machine when a UNC path is set for one relationship and a local path for another relationship.
Reason two: When a user logs in using an IIS anonymous account, he has the rights to the local machine, but for a machine with a UNC path, the machine will not think that the account you are currently logged in anonymously is in it. That's also legal. This way it won't allow you to access the resources on it, causing errors.
[Solution]
1. In the IIS tool, change the IIS anonymous account to another domain-based account. (That is, do not use anonymous login)
2. Or create an account the same as the current anonymous account on the machine where you want to access the resources, and use the same password.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005' Microsoft][ODBC
Microsoft SQL Driver] Logon Failed()
[reason]
This error is generated by SQL Server when it does not accept or cannot recognize the login account, or is not logged in as an administrator.
It may also be caused by the fact that there is no SQL mapping account in NT.
[Solution]
Log in with the system administrator account (SA). The general password should be empty. Note that CoonectString must be used at this time and the DSN file cannot be used. Because the username and password are not saved in the DSN. Check whether NT has mapped an account to SQL.
[error message]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server] Login failed- User: Reason:
Not defined as a valid user of a trusted SQL Server connection.
[reason]
This error is generated by SQL Server when it does not accept or cannot recognize the login account, or is not logged in as an administrator.
It may also be caused by the fact that there is no SQL mapping account in NT.
[Solution]
In SQL Server's Enterprise Manager, select Server/SQL Server/Configure[ASCII
133]/Security Options/Standard. If running in IIS4, deselect the Password Synchronization option for the project.
[error message]
Microsoft OLE DB Provi