I have written the following small test code but get the same result no matter how I code the Update statement. The Update statment always returns a syntax error. Any suggestions?
Code:
Public Class Form1
Dim con As New OleDb.OleDbConnection
Dim dbProvider As String
Dim dbSource As String
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter()
Dim OrdersTable As String
Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SaveButton.Click
'Open and access the orders database
dbProvider = "Provider=Microsoft.ACE.OLEDB.12.0;"
dbSource = "Data Source=c:\NFB Associates\Temple Books\VB Software\Database9.accdb"
con.ConnectionString = dbProvider & dbSource
con.Open()
'Prepare 'Orders' table for access
OrdersTable = "SELECT * From Table1"
da = New OleDb.OleDbDataAdapter(OrdersTable, con)
da.Fill(ds, "Table1")
Dim cb As New OleDb.OleDbCommandBuilder(da)
ds.Tables("Table1").Rows(0).Item(0) = "888"
ds.Tables("Table1").Rows(0).Item(1) = "777"
da.Update(ds, "Table1")
con.Close()
End Sub
End Class
