When I run this I get an error saying that the sql syntax is wrong.
Field types are:
Time: Text
Date: Text
SalespersonID: Integer
Dim sqlWrite As String = "INSERT INTO Audit (Time, Date, SalespersonID) VALUES('" & CType(lblTime.Text, String) & "','" & CType(lblDate.Text, String) & "','" & SalespersonID & "')"
da = New OleDb.OleDbCommand(sqlWrite, Databaseconnection)
Dim temp_num As Integer
temp_num = da.ExecuteNonQuery()
Any suggestions on why this is giving me a syntax error?
I have tried this as my sqlWrite and it works fine so I know it has nothing to do with SalespersonID:
'Dim sqlWrite As String = "INSERT INTO Audit (SalespersonID) VALUES('" & SalespersonID & "')"