hi,
my vb6 code:
sSQL = "INSERT INTO OUTTURN (CUTID, SIZE, GRADE, LOT, VOLUME, PRICE, REVENUE, PERCENTAGE, INVOICE, CUSTOMER) VALUES ('" & Text2.Text & "', '" & ws1.Cells(i, 1) & "', '" & ws1.Cells(i, 2) & "', '" & ws1.Cells(i, 3) & "', '" & ws1.Cells(i, 4) & "', '" & ws1.Cells(i, 5) & "', '" & ws1.Cells(i, 6) & "', '" & ws1.Cells(i, 7) & "', '" & ws1.Cells(i, 8) & "', '" & ws1.Cells(i, 9) & "'); "
Set rsAccess = New ADODB.Recordset
rsAccess.CursorLocation = adUseClient
rsAccess.Open sSQL, objAccessConnection, adOpenKeyset, adLockOptimistic
generates this SQL command:
INSERT INTO OUTTURN (CUTID, SIZE, GRADE, LOT, VOLUME, PRICE, REVENUE, PERCENTAGE, INVOICE, CUSTOMER) VALUES ('1', '12 X 12 (20)', '2 MER & BTR', 'JGH 4200', '24960', '560', '13977.6', '0.0191063494931', '988', 'SOUTHBEACH-9348');
and it gives me SYNTAX ERROR in my program, but when I copy/paste and run it directly as Access 2000 query it works fine.
Any idea, please?
my vb6 code:
sSQL = "INSERT INTO OUTTURN (CUTID, SIZE, GRADE, LOT, VOLUME, PRICE, REVENUE, PERCENTAGE, INVOICE, CUSTOMER) VALUES ('" & Text2.Text & "', '" & ws1.Cells(i, 1) & "', '" & ws1.Cells(i, 2) & "', '" & ws1.Cells(i, 3) & "', '" & ws1.Cells(i, 4) & "', '" & ws1.Cells(i, 5) & "', '" & ws1.Cells(i, 6) & "', '" & ws1.Cells(i, 7) & "', '" & ws1.Cells(i, 8) & "', '" & ws1.Cells(i, 9) & "'); "
Set rsAccess = New ADODB.Recordset
rsAccess.CursorLocation = adUseClient
rsAccess.Open sSQL, objAccessConnection, adOpenKeyset, adLockOptimistic
generates this SQL command:
INSERT INTO OUTTURN (CUTID, SIZE, GRADE, LOT, VOLUME, PRICE, REVENUE, PERCENTAGE, INVOICE, CUSTOMER) VALUES ('1', '12 X 12 (20)', '2 MER & BTR', 'JGH 4200', '24960', '560', '13977.6', '0.0191063494931', '988', 'SOUTHBEACH-9348');
and it gives me SYNTAX ERROR in my program, but when I copy/paste and run it directly as Access 2000 query it works fine.
Any idea, please?