Hello,
I'm trying to run a simple sql command
and always get an insert error!
syntax runs good in Access, but iis throws exeption.
code:
Sub button1_click1(ByVal Source As Object, ByVal E As EventArgs)
Dim dbconn, dbcom
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & Server.MapPath("db.mdb"))
dbconn.open()
Dim sql As String = "INSERT INTO user([Fname[,[Lname],[email],[Country]) VALUES (nnnn,'T','
[email protected]',us);"
dbcom = New OleDbCommand(sql, dbconn)
dbcom.ExecuteNonQuery()
[u]
error</u>:
Syntax error in INSERT INTO statement.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
Source Error:
Line 19: dbcom = New OleDbCommand(sql, dbconn)
Line 20:
Line 21: dbcom.ExecuteNonQuery
any suggestions?
thank u