Delphi's data-aware controls are components that normally reside on a Standard palette tab but have been modified to display and manipulate the content of data in a dataset (table or query). The choice of controls is determined by how we want to present the information and how we want to let users browse (and manipulate - add or edit) through the records of a dataset.
DBEdit and DBMemo, for example, are used to represent an individual record from a dataset. The DBGrid, on the other hand, is generally used when displaying the contents of an entire dataset.
Since all the data-aware controls are counterparts to the standard Windows controls - with a few extra properties, building a functional database application should be a relatively familiar task.
All the data-aware components share one common property: data source.
Data Source
Simply put, the
TDataSource component provides a mechanism to hook dataset components to the visual data-aware components that display the data. You generally will need one datasource component for each dataset component to present a link to one or more data-aware controls.
Datasets
To create an ADO based application, Delphi provides us with four dataset components:
TADODataSet,
TAdoTable,
TADOQuery and
TADOStoredProc. All the components are designed to retrieve, present and modify the data. All those components can connect directly (as like in the previous chapter's examples) to an ADO data store (such as data in an Access database) through the
ConnectionString property or they can chare a single connection. When connecting through a
TAdoConnection the
Connection property specifies an ADO connection object to use to connect to an ADO data store.