I'm getting the error "3134 Syntax error in INSERT INTO statement" when I try to execute the following code:
sql = "Insert into dbrder_Lines (ORDER_NUMBER,LINE_NUMBER,PRODUCT_CODE,DESCRIPTION,QUANTITY_ORDERED,QUANTITY_SHIPPED,UNIT_PRICE,
UNDISCOUNTED_PRICE,EXTENDED_AMOUNT,UNDISCOUNTED_EXTENDED_AMOUNT, NOTE) "
sql = sql & "values ('" & OrderNum & "','" & LineNum & "','" & Product & "','" & ProductDesc & "',1,1," & ProductPrice & "," & ProductPrice & "," & ProductPrice & "," & ProductPrice & ",'" & rsAttendees!Grade & "')"
db.Execute (sql)
The actual sql that is generated by the code is:
Insert into dbrder_Lines
(ORDER_NUMBER,LINE_NUMBER,PRODUCT_CODE,DESCRIPTION,QUANTITY_ORDERED,QUANTITY_SHIPPED,UNIT_PRICE,
UNDISCOUNTED_PRICE,EXTENDED_AMOUNT,UNDISCOUNTED_EXTENDED_AMOUNT,NOTE)
values ('2987388','2','2009NLC/GRADE','Grade - Enter 5-12 Under "Function Note" tab',1,1,0,0,0,0,NOTE)
It will run if I delete the last field, the NOTE field where I'm assigning the value of '11' to it (in blue above). So it's something with that last field...
Anna Jaeger
iMIS Database Support
sql = "Insert into dbrder_Lines (ORDER_NUMBER,LINE_NUMBER,PRODUCT_CODE,DESCRIPTION,QUANTITY_ORDERED,QUANTITY_SHIPPED,UNIT_PRICE,
UNDISCOUNTED_PRICE,EXTENDED_AMOUNT,UNDISCOUNTED_EXTENDED_AMOUNT, NOTE) "
sql = sql & "values ('" & OrderNum & "','" & LineNum & "','" & Product & "','" & ProductDesc & "',1,1," & ProductPrice & "," & ProductPrice & "," & ProductPrice & "," & ProductPrice & ",'" & rsAttendees!Grade & "')"
db.Execute (sql)
The actual sql that is generated by the code is:
Insert into dbrder_Lines
(ORDER_NUMBER,LINE_NUMBER,PRODUCT_CODE,DESCRIPTION,QUANTITY_ORDERED,QUANTITY_SHIPPED,UNIT_PRICE,
UNDISCOUNTED_PRICE,EXTENDED_AMOUNT,UNDISCOUNTED_EXTENDED_AMOUNT,NOTE)
values ('2987388','2','2009NLC/GRADE','Grade - Enter 5-12 Under "Function Note" tab',1,1,0,0,0,0,NOTE)
It will run if I delete the last field, the NOTE field where I'm assigning the value of '11' to it (in blue above). So it's something with that last field...
Anna Jaeger
iMIS Database Support