INSERT INTO in MS Access 2010 SOMETIMES GETS ERROR: 3073 Operation must use an updateable query
Posted
by
Gary
on Stack Overflow
See other posts from Stack Overflow
or by Gary
Published on 2011-03-05T02:15:47Z
Indexed on
2011/03/05
7:24 UTC
Read the original article
Hit count: 316
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 the 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!
© Stack Overflow or respective owner