开发者

INSERT INTO in MS Access 2010 SOMETIMES GETS ERROR: 3073 Operation must use an updateable query

I get the ERROR: 3073 Operation must use an updateable query SOMETIMES, while performing an INSERT statment.

I have no problem on my windows 7 PC, but the person I am writing this for sometimes gets the error. She also has MS Access 2010 on Windows 7.

As I said I have never got it on my PC, and she only gets it sometimes. The code will insert a number of rows and then through th开发者_开发技巧e error, and other times not through the erro at all.

The error occurs if I have the code and data in one .mdb file or seperate files. Here a snippet of code:

OrderHdrInsertStmnt = " INSERT INTO ORDER_HDR " _  
& "(ORDER_ID, SOURCE_CODE, ORDER_DATE, SHIP_FNAME, SHIP_LNAME, SHIP_EMAIL, SHIP_COMP, SHIP_PHONE, SHIP_ADDR, SHIP_CITY, SHIP_STATE, SHIP_ZIP, SHIP_CNTRY, " _  
& " BILL_FNAME, BILL_LNAME, BILL_EMAIL, BILL_COMP, BILL_PHONE, BILL_ADDR, BILL_CITY, BILL_STATE, BILL_ZIP, BILL_CNTRY, " _  
& " TAX, SHIPPING, TOTAL, MOD_DATE, INSERT_DATE) " _  
& " VALUES (" _  
& "'" & OrderId & "','" & SourceCode & "','" & Orderdate & "','" & ShipFName & "','" & ShipLName & "','" & ShipEmail & "','" & ShipComp & "','" & ShipPhone & "','" & ShipAddr & "','" & ShipCity & "','" & ShipState & "','" & ShipZip & "','" & ShipCntry _  
& "','" & BillFName & "','" & BillLName & "','" & BillEmail & "','" & BillComp & "','" & BillPhone & "','" & BillAddr & "','" & BillCity & "','" & BillState & "','" & BillZip & "','" & BillCntry _  
& "','" & OrderTax & "','" & OrderShipping & "','" & OrderTotal & "','" & ImportDate & "','" & ImportDate & "');"

then I use

dbsCurrent.Execute OrderHdrInsertStmnt, dbFailOnError

Any assistance would be great!


The error you are getting usually occurs when you run an update statement against a query so it is not clear which records should be updated. You are obviously not doing that.

Is it possible then that some of the data you are concatenating into the insert statement is sometimes of wrong value, for instance string in a number or NULL or the like. That would be the most likely explanation. The most likely cause of error is some kind of non-standard input which gets concatenated into the statement.


I developed a standalone Visual Basic program using MS Access DB for a friend more than 2 years ago. Recently , he complained encountering "Operation must use an updateable query" error when adding the second record in a session. That is: each time he use the program, only the 1st record is added/updated.

After searching the web, various forum, I cannot find a likely answer.

Eventually, the solution/get-around of my case: seems that my friend's newly installed backup software (Memeo Backup) running in the background is somehow causing the problem. Disable the backup program, the program can work again.

So, try disable background programs and see if any of them is causing the problem.


Are the tables shared and are you both updating/inserting at the same time?

I'm running tests of multiuser updates on the same records.
The table is : one id and one text field,
the query is: update text = randomString WHERE id = 800 (id 800 exists...)
Execute method: CurrentDb.Execute(qry)

10 times over 200 on each computer I had the error 3073. I thus suppose this means "table locked by someone else"

For info, on an other test (same table) but in insert mode using a recordset addNew and Update I had the error 3343 (Database format not recognized)

Explicit messages :P


I had the same error on an insert. I was inserting into a linked table using a VALUES clause, which was running from VBA. When I moved the insert destination table into the local mdb, it solved the problem. Then I was able to insert all the rows from the local table into the linked table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜