This query runs perfectly in Access 2007 but when I try to execute it in my code I get Syntax error in INSERT INTO statement. Someone please help.
Dim sql1 As String
sql1 = "INSERT INTO CustomerDtl (KioskID, ClientID, Language, SalesType) VALUES ('AD903',1,'English','Wholesale')"
ObjAccess.ExecuteQuery(sql1)
And this is the ExecuteReader function:
Public Function ExecuteQuery(ByVal SQLQuery As String)
'This Function Executes SQL Statement against connection and returns number of rows affected'
dbCommand = New OleDbCommand
Call OpenConnection()
With dbCommand
.Connection = dbConnection
.CommandType = CommandType.Text
.CommandText = SQLQuery
.ExecuteNonQuery()
.Dispose()
End With
Call CloseConnection()
End Function