RAD Studio
ContentsIndex
PreviousUpNext
Setting Up Master/Detail Linked Relationships

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.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!