Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Save changes to a database
This is my codes , what I want to do is to save changes to database. [/b]
[color=Blue] Dim connstr As String = "Provider= Microsoft.Jet.OLEDB.4.0;" & _
"Data source = cdbank.mdb"
Dim dt As New DataTable
Dim sqlstr As String = "SELECT * FROM info"
Private Sub SaveToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem1.Click
Dim changes As Integer
Dim dataadapter As New OleDb.OleDbDataAdapter(sqlstr, connstr)
Dim commandbuilder As New OleDb.OleDbCommandBuilder(dataadapter)
If changes > 0 Then
MsgBox(changes & "changed rows were stored in the database ")
MsgBox("No changes made.")
But when i run the program and i load data from database and want to save the changes i have made i get this error:
Syntax error (missing operator) in query expression '((code = ?) AND ((? = 1 AND name IS NULL) OR (name = ?)) AND ((? = 1 AND serial IS NULL) OR (serial = ?)) AND ((? = 1 AND software inside IS NULL) OR (software inside = ?)))'.
I have no idea what this is about !
Anyone here can help
I mostly appreciate
0 · ·