0
I’m trying to make a CRUD here using VB.NET and Access,
only when I’m going to perform a INSERT
returns the error:
"Sintax Error in INSERT INTO statement"
Code:
con.Open()
Dim strCmd As String = "INSERT INTO Mapas (DataRegistro,NumReferencia,Local,Responsavel, OBS, Status)" & _
"Values (? ,? ,? ,? ,? ,? )"
Dim cmd As OleDbCommand = New OleDbCommand(strCmd, con)
cmd.Parameters.AddWithValue("?", txtDataRegistro.Text)
cmd.Parameters.AddWithValue("?", txtMapa.Text)
cmd.Parameters.AddWithValue("?", txtLocal.Text)
cmd.Parameters.AddWithValue("?", txtResponsavel.Text)
cmd.Parameters.AddWithValue("?", txtObs.Text)
cmd.Parameters.AddWithValue("?", chkStatus.Checked)
cmd.ExecuteNonQuery()
MsgBox("Mapa cadastrado com sucesso!" & vbCrLf & "Nome.: " & txtMapa.Text, MsgBoxStyle.Information)