I have got problem in updating the access database.
THIS IS MY CODE
//

Dim con As New OleDb.OleDbConnection
    Dim spl As String
    Dim ds As New DataSet
    Dim da As New OleDb.OleDbDataAdapter
    
 
con.ConnectionString = "PROVIDER= Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Malai\Documents\database31.mdb"
        con.Open()
        spl = "select * from REMAINDERDETAILS"
        da = New OleDb.OleDbDataAdapter(spl, con)
        da.Fill(ds, "remind")
        con.Close()
        
        ds.Tables("remind").Rows(0).Item("PERSON NAME") = nametxt.Text
        ds.Tables("remind").Rows(0).Item("DESCRIPTION") = descriptiontxt.Text
        ds.Tables("remind").Rows(0).Item("REMDATE") = datetxt.Text
        da.Update(ds, "remind")
//
this gives me the following error

//da.Update(ds, "remind")//

Syntax error (missing operator) in query expression '((NUMBER = ?) AND ((? = 1 AND PERSON NAME IS NULL) OR (PERSON NAME = ?)) AND ((? = 1 AND DESCRIPTION IS NULL) OR (DESCRIPTION = ?)) AND ((? = 1 AND REMDATE IS NULL) OR (REMDATE = ?)))'.

Can anybody help me to proceed.

In order to update dataset/datatable you have to configure Insert,Update,Delete, and Select command of DataAdapter.


Use OleDbCommandBuilder class to populate insert,delete, and update commands.

Dim con As New OleDb.OleDbConnection
    Dim spl As String
    Dim ds As New DataSet
    Dim da As New OleDb.OleDbDataAdapter
    
con.ConnectionString = "PROVIDER= Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Malai\Documents\database31.mdb"
        con.Open()
        spl = "select * from REMAINDERDETAILS"
        da = New OleDb.OleDbDataAdapter(spl, con)

        Dim cb as new OleDb.OleDbCommandBuilder(da)
 
        da.Fill(ds, "remind")
        con.Close()
        
        ds.Tables("remind").Rows(0).Item("PERSON NAME") = nametxt.Text
        ds.Tables("remind").Rows(0).Item("DESCRIPTION") = descriptiontxt.Text
        ds.Tables("remind").Rows(0).Item("REMDATE") = datetxt.Text
        da.Update(ds, "remind")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.