Mega Code Archive

 
Categories / Delphi / Examples
 

Using datasources in other forms

If you want to use Tables, Queries or DataSources in secondary forms, you could place a new DataSource and write in the OnCreate-Event of the second form: DataSource1.DataSet := Form1.Table1; or you can assign the DataSource of the data-aware components to Form1.DataSource1. From Delphi 2 on this is also possible with the Object Inspector as well. In Delphi 1 you loose design time view of the data. Another way would be to use DataModules (Delphi 2 and higher). See the manual.