The use of hierarchical recordsets (data shaping) is a feature introduced in ADO 2.0 that allows you to build shaped recordsets. This type of recordset is very much like the master-detail relationship between tables. The title and item tables in the FmLib database are an example of a master-detail relationship. The master (title) has a one-to-many relationship with the detail (item). Windows® Explorer is another example that shows hierarchy. You can think of the directories as a parent recordset, the subdirectories as the links to the child recordsets, and the files as the fields within parent and child recordsets. The following diagram shows what the hierarchical recordset from the AdvancedSearch method looks like.
Before hierarchical recordsets were available, you had two options when accessing multiple tables:
Now, hierarchical recordsets can represent information more efficiently. Data shaping allows a column in the parent recordset to contain a child recordset (or chapter) of its own. You can append multiple child recordsets to each parent recordset and the child recordsets can in turn have child recordsets. The shaped recordset used in the AdvancedSearch method has two child recordsets: authors and critique.
Advantages of using hierarchical recordsets: