I am trying to upload data into an Access db from vb.net. The data was parsed out from text files. Everything seems to be working fine up till the .execute point. The debugger insists there is a syntax error in my statement, but when I check my insert into statement, I get what I expect. What am I doing wrong? Here is my code.:
[code=vb]Dim str As String
Dim s As ADODB.Connectio n = New ADODB.Connectio n
Dim cmd As OleDbCommand
s.ConnectionStr ing = "Provider=Micro soft.Jet.OLEDB. 4.0;" & "Data Source=" & "c:\x.mdb" & ";" & "Persist Security Info=False"
str = "INSERT INTO IS " & _
"(Fi,Da,St,En,I n,Ba,Wa,Bat,Ele ,Ver,VS,BeD,Ee) " & _
" VALUES (" & strFi & "," & strDa & "," & strST & "," & strET & "," & strIn & "," & strBS & "," & strWa & "," & strBT & "," & strEer & "," & strVS & "," & strVSt & "," & strBD & "," & strEe & ")"
s.Execute(str)
s.Close()[/code]
[code=vb]Dim str As String
Dim s As ADODB.Connectio n = New ADODB.Connectio n
Dim cmd As OleDbCommand
s.ConnectionStr ing = "Provider=Micro soft.Jet.OLEDB. 4.0;" & "Data Source=" & "c:\x.mdb" & ";" & "Persist Security Info=False"
str = "INSERT INTO IS " & _
"(Fi,Da,St,En,I n,Ba,Wa,Bat,Ele ,Ver,VS,BeD,Ee) " & _
" VALUES (" & strFi & "," & strDa & "," & strST & "," & strET & "," & strIn & "," & strBS & "," & strWa & "," & strBT & "," & strEer & "," & strVS & "," & strVSt & "," & strBD & "," & strEe & ")"
s.Execute(str)
s.Close()[/code]
Comment