0

I am trying to update an MS-Access database from a Windows Form as seen below:

Form used to update database

The user fills in the form and all the necessary fields are databound to the database. I then use the following code to execute the update:

 Private Sub ADD_Save_Click(sender As Object, e As EventArgs) Handles ADD_Save.Click

        JobRecordsBindingSource.EndEdit()
        Job_RecordsTableAdapter.Update(Database_Job_RecordsDataSet.Job_Records)
        Database_Job_RecordsDataSet.AcceptChanges()
        Call Initialise_Screen(1)


    End Sub

My database then updates to show the following:

After form has been filled in

But my database does not replicate the changes, only the gridview does. Any ideas?

Note: I create a new row on a SelectedTabIndexChange event in the Intialise_Screen sub just incase anyone was wondering what that was.

LBPLC
  • 1,570
  • 3
  • 27
  • 51
  • How do you check the missing data? Are you stopping the application and restarting it when you discover the missing update? Or are you checking directly with the access interface? Could you post your connection string? – Steve Mar 26 '15 at 11:16
  • @Steve Hi, My connection string is `Provider=Microsoft.ACE.OLEDB.12.0;Data Source="|DataDirectory|\Database Job Records.accdb"`. I check to see if the database has been updated by physically opening it. But nothing has changed – LBPLC Mar 26 '15 at 11:30
  • 1
    Take a look at [this answer](http://stackoverflow.com/questions/17147249/why-saving-changes-to-a-database-fails/17147460#17147460). It is relative to Sql CE but the same troubles apply to Access – Steve Mar 26 '15 at 11:57
  • Do you get an error? – Mark C. Mar 26 '15 at 13:07

0 Answers0