ASP return operations must use updatable query errors.

Source: Internet
Author: User
Tags microsoft access database

Symptom
When you use ActiveX Data Objects (ADO) with Active Server Pages (ASP), you may encounter the following common errors:
Microsoft ole db provider for ODBC drivers error '000000'
[Microsoft] [ODBC Microsoft Access 97 driver] operation must use an updateable query.

This article describes the four main causes of this error and the corresponding alternative methods. Although this article discusses Microsoft Access databases, the information provided here applies to other types of databases.

This is caused by design.

Solution
This error is typically encountered when your script attempts to perform updates or other operations that change the information in the database. The cause of this error is that ADO cannot write data to the database due to the following reasons:
1. The most common cause is that the Internet Guest Account (iusr_machine, which belongs to the "everyone" group by default) has no write permission on database files (. mdb. To solve this problem, use the "Security" option card in Explorer to adjust the properties of this file so that the Internet Guest account has the correct permissions.
Note: When using Microsoft Access database with ADO, you must also grant the Internet Guest account the write permission to the directory containing. mdb files. This is because jet will create a. LDB file for processing database locks. Because Jet mayTemp"Directory to create temporary files, so you may also need to grant read/write permissions to this folder. Generally located in c: \ windows \ http://www.aspxuexi.com/
2. The second cause of this error is that the database is not opened in the correct mode with write permission. If you perform an open operation on the connection object, you should use the mode attribute to indicate the permissions on the connection, as shown below:
SQL = "update products set unitprice = 2 ;"
Set conn = server. Createobject ("ADODB. Connection ")
Conn. mode = 3' = admodereadwrite
Conn. Open "mydsn"
Conn. Execute (SQL)
Conn. Close
Note: by default, mode is set to 0 (admodeunknown), which is usually allowed to be updated.
3. Another cause of this error is that in ODBC manager, the "read-only" setting on the "options" page of DSN may be selected.
4. The last question and alternative method apply to all SQL data sources. This error can be caused by SQL statements that violate the integrity of database references. The following are some of the most common failed queries:
• The simplest query group is the query that you cannot change: Cross-Table query with uniquevalue attribute set to yes, SQL transfer query, joint query or update (that is, Table Generation) operation query.
• Another common cause is that the indexes of the joined ODBC table are not unique. In this case, SQL cannot guarantee that the records in the table are unique, and the field values in the table will change with the query.
• There is indeed a reliable alternative for one reason. If you try to update the "one" join field of the "one-to-many" query, the Operation will fail unless you enable cascading update. In this way, you can delegate the integrity of the reference to the jet engine.

 

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.