Delphi and Access walkthrough
Updating the database
|
Being able to view the data is one thing, but we need to be able to update it.
In this example, using the test database, we'll set the score from a drop down 'Combobox', then write the new score back to the Access database.
Note: Before you try the coding below - make sure that your database will update by making changes in the DBEdit fields and writing to the database by clicking on the green tick in the Navigator. |
|
Simply updating the DBEdit.text is not enough. We need to actually update the field in the query object - and then post that change back to the database itself. The steps are:
procedure TForm3.ComboBox1Change(Sender: TObject); This should work and the database changes should be visible in access, if you reload the database.
|