SQL Error
-
I am getting a syntax error in this SQL statement. But i can't figure out what it is. Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Whole code segment is below Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Dim com As New OleDb.OleDbCommand com.Parameters.Add("@User", OleDb.OleDbType.Char).Value = txtUser.Text com.Parameters.Add("@Pass", OleDb.OleDbType.Char).Value = txtpass.Text com.Parameters.Add("@Complete", OleDb.OleDbType.Char).Value = txtcomplete.Text com.Parameters.Add("@admin", OleDb.OleDbType.Char).Value = isadm what is the error of SQL statement.
-
I am getting a syntax error in this SQL statement. But i can't figure out what it is. Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Whole code segment is below Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Dim com As New OleDb.OleDbCommand com.Parameters.Add("@User", OleDb.OleDbType.Char).Value = txtUser.Text com.Parameters.Add("@Pass", OleDb.OleDbType.Char).Value = txtpass.Text com.Parameters.Add("@Complete", OleDb.OleDbType.Char).Value = txtcomplete.Text com.Parameters.Add("@admin", OleDb.OleDbType.Char).Value = isadm what is the error of SQL statement.
When the syntax error isn't obvious, most often it is due to a field name matching a keyword; the remedy is to put them all inside square brackets. As in
[password]
. :)Luc Pattyn [My Articles] Nil Volentibus Arduum
-
I am getting a syntax error in this SQL statement. But i can't figure out what it is. Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Whole code segment is below Dim sql As String = "INSERT INTO Users (UserID, Password, CompleteName, Admin) VALUES (@User, @Pass, @Complete, @admin)" Dim com As New OleDb.OleDbCommand com.Parameters.Add("@User", OleDb.OleDbType.Char).Value = txtUser.Text com.Parameters.Add("@Pass", OleDb.OleDbType.Char).Value = txtpass.Text com.Parameters.Add("@Complete", OleDb.OleDbType.Char).Value = txtcomplete.Text com.Parameters.Add("@admin", OleDb.OleDbType.Char).Value = isadm what is the error of SQL statement.
Are you missing this statement ?
com.commandText = SQL
-
When the syntax error isn't obvious, most often it is due to a field name matching a keyword; the remedy is to put them all inside square brackets. As in
[password]
. :)Luc Pattyn [My Articles] Nil Volentibus Arduum