Creating Master-Detail Relationships
Go Up to Using Table Type Datasets
Table type datasets can be linked into master/detail relationships. When you set up a master/detail relationship, you link two datasets so that all the records of one (the detail) always correspond to the single current record in the other (the master).
Table type datasets support master/detail relationships in two very distinct ways:
- All table type datasets can act as the detail of another dataset by linking cursors. This process is described in Making the Table a Detail of Another Dataset.
- TTable, TSQLTable, and all client datasets can act as the master in a master/detail relationship that uses nested detail tables. This process is described in Using Nested Detail Tables.
Each of these approaches has its unique advantages. Linking cursors lets you create master/detail relationships where the master table is any type of dataset. With nested details, the type of dataset that can act as the detail table is limited, but they provide for more options in how to display the data. If the master is a client dataset, nested details provide a more robust mechanism for applying cached updates.
Note: No more than 64 master-detail relationships can be supported. For example, if aTClientDataSet contains more than 64 TSQLTable components with master-detail relationships, an error message might appear, such as "Operation not applicable".