Data Shaping

Microsoft ActiveX Data Objects (ADO)

Data Shaping

Data shaping provides a way to query a data source and return a Recordset that represents a parent-child relationship between two or more logical entities (a hierarchy). A classic example of a hierarchical relationship is customers and orders. For every customer in a database, there can be zero or more orders. Regular SQL provides a means of retrieving the data using JOIN syntax, but this can be inefficient and unwieldy because redundant parent data is repeated in each record returned for a given parent-child relationship. Data shaping can relate a single parent record in the parent recordset to multiple child records in the child recordset, avoiding the redundancy of a JOIN.

The data shaping syntax also provides other capabilities. Developers can create new Recordset objects without an underlying datasource by using the NEW keyword to describe the fields of the parent and child recordsets. The new Recordset object can be populated with data and persistently stored. Developers can also perform various calculations or aggregations (for example, SUM, AVG, or MAX) on child fields and then create a parent recordset by deriving parent column values from these grouped child records.

See the following topics to learn more about data shaping: