Using TDataSet Descendants
Go Up to Understanding Datasets Index
TDataSet has several immediate descendants, each of which corresponds to a different data access mechanism. You do not work directly with any of these descendants. Rather, each descendant introduces the properties and methods for using a particular data access mechanism. These properties and methods are then exposed by descendent classes that are adapted to different types of server data. The immediate descendants of TDataSet include
- TBDEDataSet, which uses the Borland Database Engine (BDE) to communicate with the database server. The TBDEDataSet descendants you use are TTable, TQuery, TStoredProc, and TNestedTable. The unique features of BDE-enabled datasets are described in Using the Borland Database Engine
- TCustomADODataSet, which uses ActiveX Data Objects (ADO) to communicate with an OLEDB data store. The TCustomADODataSet descendants you use are TADODataSet, TADOTable, TADOQuery, and TADOStoredProc. The unique features of ADO-based datasets are described in Working with ADO Components.
- TCustomSQLDataSet, which uses dbExpress to communicate with a database server. The TCustomSQLDataSet descendants you use are TSQLDataSet, TSQLTable, TSQLQuery, and TSQLStoredProc. The unique features of dbExpress datasets are described in Using dbExpress Datasets.
- TIBCustomDataSet, which communicates directly with an InterBase database server. The TIBCustomDataSet descendants you use are TIBDataSet, TIBTable, TIBQuery, and TIBStoredProc.
- TCustomClientDataSet, which represents the data from another dataset component or the data from a dedicated file on disk. The TCustomClientDataSet descendants you use are TClientDataSet, which can connect to an external (source) dataset, and the client datasets that are specialized to a particular data access mechanism (TBDEClientDataSet, TSimpleDataSet, and TIBClientDataSet), which use an internal source dataset. The unique features of client datasets are described in Using Client Datasets - Overview
Some pros and cons of the various data access mechanisms employed by these TDataSet descendants are described in Using Databases.
In addition to the built-in datasets, you can create your own custom TDataSet descendant--for example to supply data from a process other than a database server, such as a spreadsheet. Writing custom datasets allows you the flexibility of managing the data using any method you choose, while still letting you use the VCL data controls to build your user interface. For more information about creating custom components, see Overview of Component Creation.
Although each TDataSet descendant has its own unique properties and methods, some of the properties and methods introduced by descendent classes are the same as those introduced by other descendent classes that use another data access mechanism. For example, there are similarities between the "table" components (TTable, TADOTable, TSQLTable, and TIBTable). For information about the commonalities introduced by TDataSet descendants, see Types of Datasets.