I’ve searched for hours for a solution to this problem but nothing I’ve read has helped. I’m getting this error when trying to add this record to an Access database.
this is the code
Try
conn.Open()
Dim cmd As New OleDb.OleDbCommand("insert into Table1([FullName]),([agency]),([shelf]),([dt]) values (@FullName),(@agency),(@shelf),(@dt)", conn)
cmd.Parameters.Clear()
cmd.Parameters.AddWithValue("@FullName", txt_name.Text)
cmd.Parameters.AddWithValue("@agency", txt_agen.Text)
cmd.Parameters.AddWithValue("@shelf", txt_she.Text)
cmd.Parameters.AddWithValue("@dt", txt_DT.Text)
i = cmd.ExecuteNonQuery
If i > 0 Then
MsgBox("Records Save!")
Else
MsgBox("Failed!")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
conn.Close()
loading()
clear()
what the problem can someone help
New contributor
Koweenss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.