How to Use the Sample

Click on the Use Connection Definition combo box and select an option.

Modify the tables and interact with the provided buttons.

Files

File in Delphi

Contains

SchemaAdapter.dprojSchemaAdapter.dpr

The project itself.

fSchemaAdapter.pasfSchemaAdapter.fmx

The main form.

Implementation

When you run the application, click on the Use Connection Definition combo box and select an option in order to define a connection. When you select an item of the combo box, the Open method is called to open all datasets associated with the schema adapter related to this connection. Then, you will see two tables, one in each TDBGrid. Both TDBGrids are used to display and manipulate records from a dataset in a tabular grid. Once the TDBGrids are filled, you can interact with the sample. Each of the following buttons implements an OnClick event to do what is described below:

Change or edit any data record. Then an OnDataChange event uses the ChangeCount property to display the number of changes in the changes log.

Interact with the buttons that provide the sample:

The SavePoint button uses the SavePoint property to return the current position in the changes log.

The RevertPoint button makes the changes log returns to the state when the value of SavePoint was obtained.

The UndoLastChange button uses the UndoLastChange method to cancel the last record change in the schema adapter changes log and to remove the record from the changes log.

The CancelUpdates button uses the CancelUpdates method to cancel changes for all records in this schema adapter changes log and to remove them from the changes log.

The ApplyUpdates button uses:

The ApplyUpdates method to apply changes for all records in the centralized change journal to the database.

The CommitUpdates method to mark all the records in this schema adapter changes log as unmodified and to remove them from the changes log.