Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

[RESOLVED] insert query statement error

$
0
0
HIIII
i m using the below insert query which has 90 fields in it

while executing it gives error insert syntax error
i have debug the line the close bracket is missing at end
how can i rectified it or add it

Quote:

strsql = "INSERT INTO Robotonlineinfo (MESSAGE_ID,CONNECTION_ID,ROBOT_ID,RESERVED_CODE,X_POSITION,Y_POSITION,THETA,LOAD_UNLOAD,ORDER_NOORD ER,OPERATION_CODE1,OPERATION_CODE2,LOW_BATTERY_WARNING,LOW_BATTERY_ALERT,SOON_AT_DISTANCE,TM_NOTM,ST ATUS_CODE1,STATUS_CODE2,BLOCKED_NOTBLOCKED,FW_BW1,FW_BW2,OUTSIDE_SAFETY_ZONE,NAVIGATION_ERROR,GOING_ TO_HOME,CANCELLED,PHYSICAL_POSTION_UNKNOWN,LOGICAL_POSTION_UNKNOWN,ON_TARGET,WHAT_IS_GOING_ON,END_SE GMENT,NOT_IN_SYSTEM,SEGMENT_TRAVELING,DISTANCE_TRAVELING,BITS5,BITS6,BITS7,BITS8,BITS9,BITS10,BITS11 ,PLCBITS1,PLCBITS2,PLCBITS3,PLCBITS4,PLCBITS5,PLCBITS6,PLCBITS7,PLCBITS8,PLCBITS9,PLCBITS10,PLCBITS1 1,PLCBITS12,PLCBITS13,PLCBITS14,PLCBITS15,PLCBITS16,ERRORCODE 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,PLC_CODE,SEG_ID,DISTANCE_ON_SEGMENT,POINT_ID,ROBOT_HEAD,STATU S,ORDER_ID,ORDER_STATUS,LAST_UPDATED) VALUES ('" & splitstrdata(0) & "','" & splitstrdata(1) & "'," _
& ("'" & splitstrdata(2) & "','" & splitstrdata(3) & "','" & splitstrdata(11) & "','" & splitstrdata(12) & "','" & splitstrdata(13) & "','" & c1(1) & "','" & c1(2) & "','" & c1(3) & "','" & c1(4) & "','" & c1(5) & "','" & c1(6) & "','" & c1(7) & "','" & c1(8) & "','" & c1(9) & "','" & c1(10) & "','" & c1(11) & "','" & c1(12) & "','" & c1(13) & "','" & c1(14) & "','" & c1(15) & "','" & c1(16) & "','" & c2(1) & "','" & c2(2) & "','" & c2(3) & "','" & c2(4) & "','" & c2(5) & "','" & c2(6) & "','" & c2(7) & "','" & c2(8) & "','" & c2(9) & "','" & c2(10) & "','" & c2(11) & "','" & c2(12) & "','" & c2(13) & "','" & c2(14) & "','" & c2(15) & "','" & c2(16) & "','" & c3(1) & "','" & c3(2) & "','" & c3(3) & "','" & c3(4) & "','" & c3(5) & "','" & c3(6) & "','" & c3(7) & "','" & c3(8) & "','" & c3(9) & "','" & c3(10) & "','" & c3(11) & "','" & c3(12) & "','" & c3(13) & "','" & c3(14) & "','" & c3(15) & "','" & c3(16) & "','" & c4(1) & "','" & c4(2) & "','" & c4(3) & "','" & c4(4) & "','" & c4(5) & "'," _
& ("'" & c4(6) & "','" & c4(7) & "','" & c4(8) & "','" & c4(9) & "','" & c4(10) & "','" & c4(11) & "','" & c4(12) & "','" & c4(13) & "','" & c4(14) & "','" & c4(15) & "','" & c4(16) & "','" & splitstrdata(8) & "','" & splitstrdata(9) & "','" & splitstrdata(10) & "','" & splitstrdata(16) & "','" & splitstrdata(17) & "','" & splitstrdata(14) & "','" & splitstrdata(18) & "','" & splitstrdata(15) & "','" & Format(Now, "DD-MM-YYYY HH:MM:SS") & "'")) & ")"
Debug.Print strsql

rsorinfo.Open strsql, con, adOpenKeyset, adLockPessimistic

And output of debug is

Quote:

INSERT INTO Robotonlineinfo (MESSAGE_ID,CONNECTION_ID,ROBOT_ID,RESERVED_CODE,X_POSITION,Y_POSITION,THETA,LOAD_UNLOAD,ORDER_NOORD ER,OPERATION_CODE1,OPERATION_CODE2,LOW_BATTERY_WARNING,LOW_BATTERY_ALERT,SOON_AT_DISTANCE,TM_NOTM,ST ATUS_CODE1,STATUS_CODE2,BLOCKED_NOTBLOCKED,FW_BW1,FW_BW2,OUTSIDE_SAFETY_ZONE,NAVIGATION_ERROR,GOING_ TO_HOME,CANCELLED,PHYSICAL_POSTION_UNKNOWN,LOGICAL_POSTION_UNKNOWN,ON_TARGET,WHAT_IS_GOING_ON,END_SE GMENT,NOT_IN_SYSTEM,SEGMENT_TRAVELING,DISTANCE_TRAVELING,BITS5,BITS6,BITS7,BITS8,BITS9,BITS10,BITS11 ,PLCBITS1,PLCBITS2,PLCBITS3,PLCBITS4,PLCBITS5,PLCBITS6,PLCBITS7,PLCBITS8,PLCBITS9,PLCBITS10,PLCBITS1 1,PLCBITS12,PLCBITS13,PLCBITS14,PLCBITS15,PLCBITS16,ERRORCODE 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,PLC_CODE,SEG_ID,DISTANCE_ON_SEGMENT,POINT_ID,ROBOT_HEAD,STATU S,ORDER_ID,ORDER_STATUS,LAST_UPDATED) VALUES ('3','1','1','0','12311.94','43889.33','0','False','False','False','False','False','False','False',' False','False','False','False','False','False','False','False','False','False','False','
False','False','False','False','False','False','False','False','False','False','False','False','Fals e','False','False','False','False','False','False','False','False','False','False','False','False',' False','False','False','False','False','False','False','False','False','False','False','False','Fals e','False','False','False','False','False','False','False','False','0','1','15863.51','3','0','FREE' ,'','','17-09-2013 18:29:30'

And when is execute it in access query design window it execute but cases 1 error then it add the record

ERROR is as shown in image
Name:  error insert.png
Views: 65
Size:  60.6 KB


Pls help me
Attached Images
 

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>