TurboDB VCL Component Library


TTdbTable        See also

Previous  Top  Next

References the master data source for a master-detail view.

Delphi syntax:

property MasterSource: TDataSource;

C++ syntax:

__property Db::TDataSource* MasterSource = {read=FMasterSource, write=SetDataSource};


Use MasterSource to specify the name of the data source component whose DataSet property identifies a data set to use as a master table in establishing a master-detail relationship between this table and another one. Each time the current record in the master table changes, the new values in those fields are used to select corresponding records in this table for display.

TurboDB can link the records of the detail table to the records in the master table in three different ways:

The default relationship is defined by link and relations fields within the tables. To use this kind of relationship, leave the MasterFields and the DetailFields properties empty.
The standard relationship is defined by the MasterFields property and works only when the matching fields in the detail and the master table have the same names.
To match detail fields and master fields with different field names, you can use the DetailFields property in addition to the MasterFields property.

Note: At design time choose an available data source from the MasterSource property's drop-down list in the Object Inspector.

Attention: All tables used to establish a master-detail relationship must belog to the same database