Cannot use ''; the file is already in use. Explanation: An unhandled exception occurred during execution of the current web request. Please check the stack trace for details about the error and where in the code the error occurred:
Microsoft JET Database Engine (0x80004005)
'' cannot be used; the file is already in use.
Cause of error: Solution: The iis user does not have enough permissions on the data directory, and the ldb file cannot be automatically generated.
Solution: Add anonymous internet users write permissions to the data directory
Exception details: System.Data.OleDb.OleDbException: Cannot use ''; file is already in use.
This usually occurs when the website program accesses the database.
There are three possible reasons for this error:
1. The iis user does not have enough permissions on the data directory, and the ldb file cannot be automatically generated.
2. The database to be connected has been opened and occupied! Closing the database can solve the problem! (Maybe someone else is downloading your database!)
3. For virtual host users, the space is full and the purchased space has been used up.
Solution:
1. In the first situation, if you purchased space, please contact the space provider to handle it; if you are a space provider or server administrator, because the IIS user does not have read and write permissions on the database directory, the specific solution is: Open My Computer , find the directory where the program is located (for example: D:/wwwroot/), right-click the directory, select the security menu item, select the user, and add the read and write permissions of everyone user. After confirming, refresh the browser page, and it will be correct Use the system.
2. If there are still problems, the space provider or server administrator can restart the server. In this way, the database usage can be released. If it is a virtual hosting space, please contact the space provider to handle it. Please confirm whether you are uploading or downloading the database yourself, causing the database file to be occupied.
3. If there is insufficient space, contact the space provider to spend money to increase the website space or upgrade the configuration.
Other relevant reference content:
--------------------
[analyze]
1. Solution: The IIs user does not have enough permissions on the data directory, and the ldb file cannot be automatically generated. Please add the anonymous internet user's write permissions on the data directory.
Result: Still not working
2. Log out of your Windows account and log in again.
Result: It works. It seems that a certain process is indeed occupying this mdb file.
Note: To determine whether an mdb file is occupied by a process, it depends on whether there is an ldb file with the same name in the same directory. If so, it is occupied. When released, the ldb file disappears.
--------------------
Problem: Cannot be used; file is already in use, Microsoft JET Database Engine
Solution: The IIs user does not have enough permissions on the data directory, and the ldb file cannot be automatically generated. Please add the anonymous internet user's write permissions on the data directory.
See:Microsoft Support ---Microsoft Knowledge Base Article - 289681