Reshaping

Microsoft ActiveX Data Objects (ADO)

ADO 2.5

Reshaping

A Recordset created by a clause of a shape command may be assigned an alias name (typically with the AS keyword). The alias of a shaped Recordset can be referenced in an entirely different command. That is, you may reuse, or reshape, a previously shaped Recordset in a new shape command. To support this feature, ADO provides a property, Reshape Name.

Reshaping has two main functions. The first is to associate an existing Recordset with a new parent Recordset.

Example

. . . 
rs1.Open "SHAPE {select * from Customers} " & _
         "APPEND ({select * from Orders} AS chapOrders " & _
         "RELATE CustomerID to CustomerID)", cn

rs2.Open "SHAPE {select * from Employees} " & _
         "APPEND (chapOrders RELATE EmployeeID to EmployeeID)", cn
. . . 

The second function is to enable non-chaptered access to existing child Recordset objects, using the syntax "SHAPE <recordset reshape name>".

Note   You cannot append columns to an existing Recordset, reshape a parameterized Recordset or the Recordset objects in any intervening COMPUTE clause, or perform aggregate operations on any Recordset descendant from the Recordset being reshaped. The Recordset being reshaped and the new shape command must both use the same Connection.

See Also

Data Shaping

© 1998-2003 Microsoft Corporation. All rights reserved.