Hi All,
I'm trying to create a first Database and use a AccessDatabase to do so.
The problem I have is that:
- Can't create a new Row
- Can't update my database
- Can't commit my database
Every time I've got an erros saying that:
Object reference not set to an instance of an object.
Here's my code to update my database:
Thanks in advance,Code:Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Dim cb As New OleDb.OleDbCommandBuilder(da) da.Fill(ds, "AddressBook") ds.Tables("AddressBook").Rows(inc).Item(1) = IDTextBox.Text ds.Tables("AddressBook").Rows(inc).Item(1) = FirstNameTextBox.Text ds.Tables("AddressBook").Rows(inc).Item(2) = SurnameTextBox.Text da.Update(ds, "AddressBook") MsgBox("Data updated") End Sub
sparrow1





Reply With Quote