Q: Why do I execute dynamic SQL reports error information in ASP? Prompt statement syntax error
answer:
Sometimes when writing ASP with conn.execute(sql) to query, update, and insert Access database data, the correct statements often show SQL statement errors, which is quite annoying. I have summarized them and can appropriately add "[" and "]" to the fields to solve the problem:
The code copy is as follows:
Example 1: select*from
If an error occurs, you can change it to: select*from[a]
Example 2: UPDATE[user]SETpassword='"&data1&"'wheresecname='"&data2&"'"
If an error occurs, it can be changed to: UPDATE[user]SET[password]='"&data1&"'wheresecname='"&data2&"'"
Example 3: INSERTINTOmybook(name, by,mobile)VALUES('"&data1&"','"&data2&"','"&data3&"')"
If an error occurs, you can change it to:
INSERTINTOmybook([name],[by],[mobile])VALUES('"&data1&"','"&data2&"','"&data3&"')"
Q: Why does the runtime always prompt "Microsoft JETdatabaseEngine(0X80040E09)" that cannot be updated, and the database or object is read-only?
The code copy is as follows:
answer:
Running the Asp program on the Windows + IIS server may cause the database to be unable to be updated. The specific error message may be:
1. Microsoft JETDatabaseEngine (0x80040E09) cannot be updated. The database or object is read-only
2. Microsoft OLEDB Provider for ODBCDrivers(0x80004005)[Microsoft][ODBCMicrosoft AccessDriver] operation must use an updateable query.
3. The Microsoft JETDatabaseEngine (0x80004005) operation must use an updateable query.
There are several solutions (the solution may be different for different servers, here suppose the home directory of the website is wwwroot):
A. Right-click on the wwwroot folder - "Properties" - Cancel "Read-only"
This method is the easiest and occasionally effective
B. Right-click on the folder on your database file - "Properties" - "Security" - Add user: "IUSR_Computer Name" and open the read and write permissions of "IUSR_Computer Name"
This method is the best solution to this problem at present, and it can generally solve the problem
The "Safety" option may not be visible when clicking the right click on the XP system. Please open "Tools" - "Folder Options" - "View" - Cancel "Use Simple File Sharing (Recommended)" and then find the "Safety" option in the properties.
C. Right-click on the wwwroot folder - "Properties" - "Web Sharing" - "Shared Folder"
D. These are several ways to solve this problem at present. If you have any additional supplements from netizens, please contact http://www.venshop.com Mortal Network