Data modules

Data modules are another form-like container that we can find in Delphi. Like forms and frames, they are available both in VCL and FireMonkey frameworks. Unlike them, however, they don't accept controls, but only components. As such, they cannot be used to create graphical user interfaces. Nevertheless, they are excellent storage for datasets, SQL connections, and other non-visual components.

To create a new data module, select File | New | Other and then pick the Data Module icon in the Delphi Files branch. After pressing OK, Delphi will create a new unit and open the form designer. You will not be able to place controls on the design form, and the component palette will reflect this. While the data module is being edited, the ...

Get Hands-On Design Patterns with Delphi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.