Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Operation must use an updatable query. (Error 3073) Microsoft Access

Tags:

On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here's the code:

UPDATE CLOG SET CLOG.NEXTDUE = (     SELECT H1.paidthru      FROM CTRHIST as H1     WHERE H1.ACCT = clog.ACCT AND     H1.SEQNO = (         SELECT MAX(SEQNO)          FROM CTRHIST          WHERE CTRHIST.ACCT = Clog.ACCT AND          CTRHIST.AMTPAID > 0 AND         CTRHIST.DATEPAID < CLOG.UPDATED_ON     ) ) WHERE CLOG.NEXTDUE IS NULL; 
like image 200
Knox Avatar asked Oct 04 '08 16:10

Knox


People also ask

Why is my Access query not updateable?

Reasons why a Query or Recordset is not UpdateableThe field is a calculated field, so it can't be edited. You don't have permissions/rights to edit the table or database. The query uses VBA functions or user defined functions and the database isn't enabled (trusted) to allow code to run.

What does operation must use an updateable query mean in access?

New developers are usually faced with the “operation must use an updateable” query error when trying to update records in a database through a local or a web (online) application. Possible reasons for the occurrence of the error. Errors due to database configuration. The table doesn't have a primary key.


1 Answers

Since Jet 4, all queries that have a join to a SQL statement that summarizes data will be non-updatable. You aren't using a JOIN, but the WHERE clause is exactly equivalent to a join, and thus, the Jet query optimizer treats it the same way it treats a join.

I'm afraid you're out of luck without a temp table, though maybe somebody with greater Jet SQL knowledge than I can come up with a workaround.

BTW, it might have been updatable in Jet 3.5 (Access 97), as a whole lot of queries were updatable then that became non-updatable when upgraded to Jet 4.

--

like image 199
David-W-Fenton Avatar answered Sep 17 '22 18:09

David-W-Fenton