• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Updating a bound form using ADO

I have what I hope is a simple problem.

On the backend I have an Access 2003 database.  My connection seems to be working, since the fill command populates my text boxes.  My textboxes are bound to the dataset.

I want to be able to change the data in the text boxes and update my datasource.  Below is what I have been trying, I get no errors; however, my access database is not being updated.

        Try
            OleDbDataAdapter1.Update(DsRequests1)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

Please advise!

Thanks,
John
0
rugby148
Asked:
rugby148
  • 2
3 Solutions
 
RonaldBiemansCommented:
before you update, do something like

        Me.BindingContext(dsrequests1).EndCurrentEdit()
       OleDbDataAdapter1.Update(DsRequests1)
0
 
rugby148Author Commented:
I just gave that a try.  It did not result in an error; however, no change in the results.

Any other thoughts?
0
 
grayeCommented:
Let's check out some obvious things before we dig too deep...

Are you using an OleDbCommandBuilder or manually creating the INSERT, UPDATE, and DELETE statements?   The DataAdapter's Update method needs those statements

Does your underlying database table have a primary key?

Just as a check to make sure the databinding is working... add a DataTable.GetChanges() method and see if it returns a valid collection of rows.
0
 
RonaldBiemansCommented:
Try to end the edit on the actual table that is bound to the textboxes instead of the dataset, like

 Me.BindingContext(dsrequests1.tables(0)).EndCurrentEdit()
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now