This article was previously published under Q175168
You may encounter the following common error when you use ActiveX Data Objects(ADO) with Active Server Pages (ASP):
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access 97 Driver] Operation must use an updateable query.
This article explains the four primary causes of this error and the corresponding workarounds. Although this article refers to Microsoft Access databases, the information provided here also applies to other types of databases.
This error is typically encountered when your script attempts to perform anUPDATE or some other action that alters the information in the database.This error occurs because ADO is unable to write to the database for one ofthe following reasons:
The most common reason is that the Internet Guest account (IUSR_MACHINE), which is by default part of the "Everyone" group, does not have Write permissions on the database file (.mdb). To fix this problem, use the Security tab in Explorer to adjust the properties for this file so that the Internet Guest account has the correctpermissions.
NOTE: When using Microsoft Access databases with ADO, it is also necessary to give the Internet Guest account Write permissions on the directory containing the .mdb file. This is because Jet creates an .ldb file to handle database locking. You may also need to give read/write permission on the "Temp" folder because Jet may create temporary files in this directory.
A second cause of this error is that the database was not opened withthe correct MODE for writing. If you perform the Open on the Connectionobject, you use the Mode property to indicate the permissions on theconnection as shown here:
NOTE: By default, the MODE is set to 0(adModeUnknown), which generally allows updates.
Another cause of this error is that the "Read Only" setting may bechecked in the Options page for this DSN in the ODBC Manager.
The last issue and work around pertains to any SQL data source. The error can be caused by SQL statements that violate referential integrity ofthe database. Here are a few of the most common queries that fail:
The simplest groups to deal with are those you cannot change: crosstab,SQL pass-through, union, or update (or make-table) action queries thathave UniqueValue properties set to Yes.
Another very common cause is when the join includes linked ODBC tablesthat do not have unique indexes. In this case, there is no way for SQLto guarantee that records are unique in a table that has fields whosevalue will change with the query.
One cause does have a robust workaround. If you try to update a joinfield on the "one" side of a "one-to-many" query it will fail unlessyou turn on cascading updates. This way, you delegate referentialintegrity to the JET engine.