Showing Syntax error in Insert Query........... Error
Syntax error in INSERT INTO statement.
but i have checked the query and tested it but there is no error Is there any problem in my code below...........Please any help thanks in advance
Sub OnOk()
Dim strquerry2 As String
Dim regcommand As OleDbCommand
Try
struser = txtuser.Text
strpwd = txtpwd.Text
strusertype = cmbbxutype.Text
If openconnection() Then
strquerry2 = "INSERT INTO Users(UserName , Password , UserType) VALUES('" & struser & "','" & strpwd & "','" & strusertype & "')"
regcommand = New OleDbCommand(strquerry2, strcon)
regcommand.ExecuteNonQuery()
End If
strcon.Close()
Catch ex As Exception
MessageBox.Show(ex.Message & " " & ex.Source)
End Try
End Sub