Yeah, I found out that I was looking for an answer earlier. I asked for a long time, I didn't seem to solve it once, and I actually forgot, it is really halo ZT. . No wonder there is no progress today, well, the database is written, you can be ok tomorrow, you can go ~
The key is NTFS permission problem, if it is an ASP. The normal directory in the NET can be uploaded, and the IUSR_ computer name must be written in this directory. The front is this, but I found it still can't work, and I finally found it. It turned out to have write permissions to the ASPNET user, so that the Access database will be, this time I want to forget it. . .
Turn: Explore the best NTFS permission settings for Access 2000 / XP Database by Test
(Http://uh1.bj.163.com/cgi/readelite?i=2292285&guest=1)
We already know that ASP.NET uses ADO.NET to access the database, access to the Access database via OLEDB - we are very commonly used in one of the low-end databases. This article discusses a number of error prompts that may see in ASP.NET, see the database files created from Access 2000 and Access XP, and there is less than an error message when an error occurs. I hope to be helpful. Another point is that you want to pass this article, you have a new understanding of NTFS permissions for ASP.NET in ASP.NET. (1) The experiment process is convenient to describe, and gives a specific example to do an experiment: the application is / test, the data inventory is placed in D: / wwwroot/test/data/db1.mdb, we already know in the ASP.NET in one If you call the ASPNET virtual user, we need to give this account with a specific NTFS permission to make the ASP.NET program running normally. In order to get the most stringent NTFS permission settings, we give the minimum NTFS permissions when the experiment begins: a) D: / wwwroot / test / data / folder to the user ASPNET as follows:
Allow full control □ □ Modify □ □ reading and run √ □ listing folder directory √ □ Read √ □ write □□
b) D: /wwwroot/test/data/db1.mdb file itself gives the user ASPNET to the following permissions: √ Allow the propagation of the inheritance from the parent system to this object 1.1 For an ASPX program containing only "select" command The above permissions are set to run when running, namely: the above permissions have met the operation of such programs. 1.2 For an ASPX program containing commands such as "update" "INSERT" UPDATE ", (a) If db1.mdb is the database created by Access 2000, the following error:" / Test "application server error. --------------------------------------- Microsoft Jet Database Engine can't open file 'D: / wwwroot / test / data / '. It has been opened by other users, or no access to data. Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: System.Data.Oledb.oledBException: Microsoft Jet Database Engine does not open file 'D: / wwwroot / test / data /'. It has been opened by other users, or no access to data. (b) If db1.mdb is the database created by Access XP, the following error appears: "/ test" server error. ---------------------------------------------- Operation must use one Update query. Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: System.Data.Oledb.oledBException: Action must use an updateable query. (c) Cause Preliminary analysis: Because including "Update" "INSERT" "UPDATE", you need to write a write operation on the database file itself, so the above permissions cannot meet this requirement, and we need to further release permissions. We release some privileges, a) d: / wwwroot / test / data / folder constant: b) D: /wwwroot/test/data/db1.mdb file itself gives the user ASPNET to the following permissions: Allow refusal to complete control □ □ Modification □ □ Reading and Run √ □ List Folder Directory √ □ Read √ □ Write √ □
1.3 Continue experimentation after disconnection
(a) If db1.mdb is the database created by Access 2000, the following error appears:
Server errors in the "/ TEST" application.
------------------------------------------
Can't lock the file.
Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: System.Data.Oledb.oledBexception: You cannot lock the file.
(b) If db1.mdb is the database created by Access XP, there is no error.
(c) Cause Preliminary analysis: We found that when opening the Access database, we will generate a * .ldb file in the directory, which is an Access's lock tag. In view of this, when we guess, when the user ASPNET accesss the Access database, it is also necessary to generate a lock tag, and the directory does not allow it to write, so an error. As for the database created by Access XP, why not know this error, the reason is not known. We further release the permissions, a) D: / wwwroot / test / data / folder to the user ASPNET as follows:
Allow full control □ □ Modify □ □ reading and run √ □ listing folder directory √ □ Read √ □ write √ □ b) D: /wwwroot/test/data/db1.mdb file itself gives user ASPNET The following permissions: √ Allow the propagation of the inheritance from the parent to this object
1.4 Continue experimentation, discovering the error has been resolved, then this permissions are the "minimum authority" we need to release.
(a) If db1.mdb is a database created by Access 2000, we will find a small problem: generated * .ldb files do not delete themselves, the file still exists after access, but this problem does not affect the normal ASP.NET run.
(b) If db1.mdb is the database created by Access XP, there is no similar problem.
(c) Cause Preliminary analysis: We just gave the ASPNET to write the authority of the folder, did not give it the permissions to modify, so once the file was written, it could not modify its content, *. ldb also deleted it.
If you do not solve this problem, further release of permissions is: a) d: / wwwroot / test / data / folder to the user ASPNET as follows:
Allow full control □ □ Modify √ □ Read and run √ □ listing folder Directory √ □ Read √ □ Write √ □ b) D: /wwrow/test/data/db1.mdb file itself gives user ASPNET The following permissions: √ Allow the propagation of the inheritance from the parent to this object
1.5 Announced, the experiment: We use db1.mdb to open edit in Access, and access ASP.NET.
(a) If db1.mdb is the database created by Access 2000, we have found that there is no problem.
(b) If db1.mdb is the database created by Access XP, the following error appears:
Server errors in the / zhao application.
------------------------------------------------
Can't use ''; files are already in use.
Description: Execute an unprocessed exception during the current web request. Check the stack tracking information to learn more about the error and the code caused in the code. Abnormal Details: System.Data.Oledb.oledBexception: You cannot use ''; files are already in use.
(c) Cause Preliminary analysis: Access database is a single-user single-threaded database. When we open an edit database file in Access, it is actually in the current Windows user (such as Administrator), and ASP.NET uses ASPNET virtual User (belonging to the user group), the level is lower than the Administrator, cannot be "robbed", so there is a conflict error. As for the case of Access 2000 Ignore this problem, we don't have to discuss it, it may be that access 2000 does not consider so many factors. 1.6 Reconside a situation: change the attribute of db1.mdb to "read only", whether it is Access 2000 or Access XP
Appears in 1.2, respectively
Error prompts of their respective errors.
(2) Experimental conclusion
1. We first summarize the origin of the NTFS permission settings of the Access database file: in the ASP.NET, the default is to access the identity of the virtual user called ASPNET, you can manipulate the database, you can manage the control panel - "management Tools "- Computer Management -" Local User and Group "-" User "See this user, by default: full name: ASP.NET computer account description as: used to run an ASP.NET assist process (ASPNET_WP The account of .exe. Belong to: Users group. With such a user who belongs to the User group to perform file operations, the risk of database operation is much smaller than the risk of users with an Administrators group, which is also a consideration of ASP.NET in security. Since it is such a user who needs access, the database file itself needs, then we need to give it a certain NTFS permission to allow it to access. Obviously there is no NTFS permission license, ASPNET cannot access, operate the database, will appear in the above experiment. 2. After the above experiment, we already know that the following NTFS permission settings can meet the general needs: a) D: / wwwroot / test / data / folder to the user ASPNET as follows:
Allow full control □ □ Modify □ □ reading and run √ □ listing folder directory √ □ Read √ □ write √ □ b) D: /wwwroot/test/data/db1.mdb file itself gives user ASPNET The following permissions: √ Allow the propagation of the inheritance from the parent system to the object. We also noticed whether DB1.mdb is "read-only" file to the ASPNET access will also have an impact. 3. The above permissions settings can be directly set to the ASPNET user yourself, or it can be set to the User Group, or directly to the above-described permissions directly. Because the ASPNET is part of the UserS group, you can set permissions to the ASPNET through the user group. 4. NTFS permission is set in the "Properties" dialog box obtained after the file or folder - The "Security" tab is set. In general, consider it to the Adminitrators group to "fully control", do not easily " Refused "Tips for NTFS permission settings, you can consult network administrators, network security experts. Note: NTFS permissions are not supported in the partition in the FAT, FAT32 format. 5. Windows 2000 series, the "Security" tab of the Windows Server 2003 series is easy to find, but the "Security" tab in Windows XP Professional tab is off, you can "Control Panel" - "folder option "-" Advanced Settings "in the" Advanced Settings "in the" 高 "removal," OK ", after" OK ", and" OK ", and then follow the" Security "tab again according to the above method. . Two: ASP can't read Access database? YESUE0608 I love DIY (2002-06-17 20:18:24) ================================== ====
The following issues (resolved) / article discussion process is taken from Yesue.com
Source: http://www.yesue.com/question/show.asp? Id = 453 & catalog = Q_WEB_ASP
=======================================
problem:
There is a set of Server Edition 2000, but there is always an access to the Access database in the Web Service (IIS5), but you can read it, no matter whether it is 97 or 2000 (still a set of Office2000). Direct use without doing ODBC settings, I remember used it before NT4 (SP4 IE4.01 OP4). It seems that I didn't give update power, but I have already setup or not. There is no read-only setting for the database file.
answer:
The following instructions are all on your site file directory on the NTFS partition; what you said is generally caused by the permission setting.
In addition, there is a possibility that you use the Jet Working Group to encrypt the Access database, and your login permissions are read-only; I think this possibility should be great.
According to the general specifications, build a directory for some files to perform a write operation (such as database, or some files to write) in your site, specify permissions for this directory, and let the files in the directory inherit this directory. Safety attributes. First explain, IIS When the request is parsed, first is the built-in IIS anonymous account that you simulates into NT (this account will be automatically established, named "IUSR_ your computer name") Visit; if the local security audit of the NTFS disk directory does not allow anonymous access, and you are logged in in Windows authentication in IIS, and access will fail.
What you have to do is to check if the "IUSR_ your computer name" account of the "IUSR_Oye Computer Name" account (the key to write "permissions), no words should be added;
If you really don't want to build a directory, you can specify the safety permissions of separate MDB files with the same way.