Using the Client Dataset in Two-Tiered Client/Server Applications
Client-server based applications have a number of advantages over file-based applications. To make such an approach work, however, the client dataset requires a provider component. This article will introduce you to the dataset provider component.
Using the Client Dataset in Two-Tiered Client/Server Applications - Using Data-Aware Components with the Client Dataset (Page 3 of 4 )
Once the data has been loaded into memory, the client dataset can be used as a typical dataset providing features to sort, filter, navigate, alter and perform every other function that a dataset should be able to do. Let us now focus on how to navigate and work with records in the client dataset.
After populating the client dataset you can add data-aware controls (available in data controls tab in the tools palette in Delphi IDE ) to the form or data module to navigate through the records and modify them. There are more than a dozen data-aware controls available in the Delphi IDE, so make sure that the data-aware component you are using can handle the data type of the field to which it is linked. For instance, if you want to display a field whose data type is string and size is 15, you should bind it with a DBEdit component.
If you are not new to Delphi then you are very well aware that data-aware components require a TDataSource component to communicate with the dataset. Make sure the dataset property in the DataSource component refers to the instance of the client dataset we are working with and specify it in the data source property of the data-aware controls.
You can add the TDBNavigator component to allow the user to move between records and modify them. DBNavigator's data source property should point to the same data source that is being referred to by the data-aware components. The DBNavigator component consists of several buttons, each representing a specific database operation. You can move to next record, previous record, first and last records and also insert, edit, undo during an edit and delete records; you can also refresh the dataset to reflect the current value of the data source. If you wish to disable some of these buttons you can access them from the Visible Buttons property of the DBNavigator component.