Data.Win.ADODB.TCustomADODataSet.MasterFields

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MasterFields: WideString read GetMasterFields write SetMasterFields;

C++

__property System::WideString MasterFields = {read=GetMasterFields, write=SetMasterFields};

Properties

Type Visibility Source Unit Parent
property protected
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TCustomADODataSet

Description

Specifies field or fields on which a Master-Detail link is based.

Use MasterFields after setting the MasterSource or DataSource property to specify the names of one or more fields in another, master, dataset that are used to establish a Master-Detail relationship between this dataset and the master dataset. The master dataset is specified by assigning its data source to the MasterSource or DataSource property.

MasterFields is a string containing one or more field names in the master dataset. When the datasets are related based on two fields, separate field names with semicolons:



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



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



Each time the current record in the master dataset changes, the new values in those fields are used to select corresponding records in this table for display.

Note: At design time, use the Field Link designer to establish the master-detail relationship between two tables.

See Also