TDataModule = class(TComponent)
class PASCALIMPLEMENTATION TDataModule : public TComponent
TDataModule centralizes the handling of nonvisual components in an application.
Use a TDataModule object in an application to provide a location for centralized handling of nonvisual components. Typically these are data access components, such as TSQLDataSet, and TSQLConnection. DataModules are not limited to data access components, they can also contain other nonvisual components, such as TTimer, TOpenDialog, or TImageList.
At design time, a TDataModule object provides a visual container into which you can place nonvisual components, set their properties, and write event handlers for them. To create a data module at design time, from an existing application choose:
- File > New > Other > personality Files > Data Module
where personality is either Delpi or C++Builder.
In the unit file for the data module, you can also place any business rules that are to be applied to the application.
To make the data module available to another unit in the application, select the unit, then choose either:
- File > Use Unit (when working in Delphi)
- File > Include Unit Header (when working in C++)
This adds the data module to the uses clause for the unit.