Disasterpiece
Well-known member
Im having a problem Saving changes made to an Access DB. I can load the info from the DB into a Datagrid, and can Add rows, but when I try to use the Update Methods I get an unhandled exception of type System.Data.OleDb.OleDbException occurred in system.data.dll.
Cant figure out whats going on.
Here is my code that is attempting to write to the DB:
dsUsers is a globally declared New Dataset() if that helps.
Thanks!
Cant figure out whats going on.
Here is my code that is attempting to write to the DB:
Code:
Private Sub frmNewUser_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Dim daUsers As New OleDb.OleDbDataAdapter(sqlStr, connStr)
Dim commandBuilder As OleDb.OleDbCommandBuilder
commandBuilder = New OleDb.OleDbCommandBuilder(daUsers)
daUsers.InsertCommand = commandBuilder.GetInsertCommand()
daUsers.Update(dsUsers, "Users")
dsUsers.AcceptChanges()
daUsers.Dispose()
End Sub
dsUsers is a globally declared New Dataset() if that helps.
Thanks!