Data.Win.ADODB.TADOTable.MasterSource

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MasterSource: TDataSource read GetDataSource write SetDataSource;

C++

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

Properties

Type Visibility Source Unit Parent
property published
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TADOTable

Description

Specifies the data source component used for a Master-Detail relationship.

Use MasterSource to specify the name of the data source component whose DataSet property identifies a dataset to use as a Master table in establishing a Master-Detail relationship between this table and another one.

After setting the MasterSource property, specify which fields to use in the master table by setting the MasterFields property. At runtime 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.



ADOTable2.MasterSource := DataSource1;
ADOTable2.MasterFields := 'CustID';



ADOTable2->MasterSource = DataSource1;
ADOTable2->MasterFields = "CustID";



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

See Also