Whenever I run this bit of code I get an INSERT INTO syntax error. It might be something really simple but I cant seem to see it at the moment. Any suggestions?
Code:
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\working\sample.mdb;")
cn.Open()
For i = 0 To k - 1
str = "INSERT INTO prtinvoice (Qty,Desc,Rate,Amount) VALUES('" & tempqty(i) & "','" & tempdesc(i) & "','" & temprate(i) & "','" & tempamount(i) & "')"
cmd = New OleDbCommand(str, cn)
cmd.ExecuteNonQuery()
Next i
cn.Close()