Why do dynamic SQL report error messages in ASP? Prompt statement syntax error _ Database related

Source: Internet
Author: User
Tags odbc access database
Q: Why do dynamic SQL general report error messages in ASP? Prompt statement syntax error
For:
Sometimes write ASP with Conn.execute (SQL) query, UPDATE, insert Access database data, clearly correct statements are often displayed SQL statement errors, quite annoyed, special induction, can be appropriate for the field to add "[", "]" to resolve:
Copy Code code as follows:

Case 1:select * from a
If an error occurs, replace it with: SELECT * FROM [a]
Example 2:update [user] SET password = ' &data1& ' where secname= ' &data2& ' '
If an error occurs, change to: UPDATE [user] SET [password] = ' &data1& ' where secname= ' "&data2& '"
Example 3:insert into MyBook (name, by, Mobile) VALUES (' &data1& ', ' &data2& ', ' ' &data3& ') '
If an error occurs, change to:
INSERT into MyBook ([name], [by], [Mobile]) VALUES (' &data1& ', ' &data2& ', ' "&data3& ')"

Q: Why is the runtime always prompted that "Microsoft JET database Engine (0X80040E09)" cannot be updated, and that the database or object is read-only?
Copy Code code as follows:

For:
Running an ASP program on a WINDOWS+IIS server may cause the database to be unable to update, and the specific error message may be:
1. Microsoft JET Database Engine (0X80040E09) cannot be updated. Database or object is read-only
2. Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][odbc Microsoft Access Driver] operation must use an updatable query.
3. The Microsoft JET Database Engine (0x80004005) operation must use an updatable query.
The solutions are as follows (for different servers may be resolved differently, where the site's home directory is assumed to be wwwroot):
A, right-click on the Wwwroot folder-"Properties"-Cancel "read Only"
This method is the simplest and occasionally effective
B, on your database file folder above right-click-"Properties"-"security"-Add Users: "IUSR_ computer name" and open "IUSR_ computer name" read, Write permissions
This method is the best way to solve the problem at present, it can solve the problem generally
XP system may right-click to see the "Security" option, please open the "Tools"-"Folder Options"-"View"-Cancel "use Simple File Sharing (recommended)" and then find the "security" option in the properties
C, right-click on the Wwwroot folder-"Properties"-"Web Share"-"Shared Folders"
D, this is the current solution to the problem of several ways, if the Netizen has any additional please http://www.venshop.com mortal network
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.