MDAC 2.5 SDK - OLE DB Providers
Data Shaping Service for OLE DB


 

Controlling the Rows in a Chapter

                    Related Topics

Chapters are used to identify a group of rows within a rowset. When a hierarchical relationship is established using the SHAPE command, a chapter column is added to the parent row. The value of a chapter column in a parent row scopes the child rowset to just those rows that are related to the parent row. ADO expresses the value of a chapter column as a Recordset that contains only the child rowset rows that are in the chapter for the parent row.

ADO Technique

The Properties collection of the Recordset object contains a property called StayInsynch, which makes it possible to dedicate one Recordset to continually update to reflect the children of the latest parent. When StayInsynch is True (the default) and the position of the parent Recordset changes, the child Recordset is automatically closed and reopened with the value of the chapter column for the new parent row. This can be useful when you always want the child Recordset to reflect or stay in synch with the current position of the parent Recordset.

If StayInsynch is set to False, the child Recordset is not affected by changes in the position of the parent Recordset. This is useful when you want to search or otherwise change position in the parent Recordset without altering the child Recordset.

To set the property, follow this example:

Debug.Print rs.Properties("StayInsynch")
rs.properties("StayInsynch") = False