Setting Up Master-Detail Linked Relationships

From RAD Studio
Jump to: navigation, search

Go Up to Using dbExpress Components Index


There are two ways to use linked datasets to set up a master/detail relationship with a dbExpress dataset as the detail set. Which method you use depends on the type of unidirectional dataset you are using. Once you have set up such a relationship, the unidirectional dataset (the "many" in a one-to-many relationship) provides access only to those records that correspond to the current record on the master set (the "one" in the one-to-many relationship).

TSQLDataSet and TSQLQuery require you to use a parameterized query to establish a master/detail relationship. This is the technique for creating such relationships on all query-type datasets. For details on creating master/detail relationships with query-type datasets, see Establishing Master-detail Relationships Using Parameters.

To set up a master/detail relationship where the detail set is an instance of TSQLTable, use the MasterSource and MasterFields properties, just as you would with any other table-type dataset. For details on creating master/detail relationships with table-type datasets, see Creating Master-Detail Relationships.

See Also