Save changes to a database - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


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

sap2020sap2020 Posts: 1Member
[b]Hi ,
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.")

End If
End Sub[/color]

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


Sign In or Register to comment.