sql insert into

ranen

pinoy 'to
Local time
Yesterday, 20:37
Joined
Jun 14, 2005
Messages
29
Here is my code for inserting record to sql server. i do get an error stating that "microsoft[odbc sqlserver driver][sql server] line 1: incorrect syntax near ','

I check all the commas but don't see any error can you please help me look for that error. Thank you so much

" strSQL = "INSERT into tbltest(Caseno,CustomerID,ApprovedBy,RecoveryDate,MediaSize,MediaDataSize,OSandVer,FileSystem,HomeBusiness,RemediesTried,FailuretypeorInAccessibility,ImptFiles,ReturnMediaOn,DataLegalActions,expedite,BreakDSeal,Status,MediaType,MediaManufactor,ComputerType,ComputerManufacture,TapeSoftware,Thru,Urgency) VALUES(" & varCaseNo & "," & varCustomerID & ",'" & [txtApprovedby].Value & "','" & _
[txtDataDate].Value & "','" & [txtMediaSize].Value & "','" & [txtMediaDataSize].Value & "','" & _
[txtOSandVer].Value & "','" & [txtFileSystem].Value & "','" & [txtHomeBusiness].Value & "','" & _
[txtRemediesTried].Value & "','" & [txtFailuretypeorInAccessibility].Value & "','" & [txtImptFiles].Value & "','" & _
[txtReturnMediaOn].Value & "','" & [txtDataLegalActions].Value & "','" & [txtExpedite].Value & "'," & _
[chkBreakDSeal].Value & ", 2 ," & [txtMediatype].Value & ",'" & [txtMediamanufacture].Value & "','" & _
[txtComputerType].Value & "','" & [txtComputerManufacture].Value & "','" & [txtTapeSoftware].Value & "','In Person','" & [txtUrgency].Value & "'"""
:( :confused:
 
Simplest way to debug this is to add:

Debug.Print strSQL

after this point and examine the resulting SQL. Right off I note that you didn't close the VALUES parentheses.
 

Users who are viewing this thread

Back
Top Bottom