The information in this article applies to:
SUMMARYWhen shaping a hierarchical recordset, examine the Type property of each field object to determine if it is actual data or a child recordset (Type = adChapter). MORE INFORMATIONConsider the following sample SHAPE statement:
The first N columns of the recordset returned correspond to the columns
returned by the SQL statement in the first set of brackets after the SHAPE statement. That is, the first N columns will be actual data. After that, a given column in the recordset may be of type adChapter, which indicates a child recordset, or it could be data from a calculated column. (This is not demonstrated in the preceding SQL statement.)
The following Visual Basic sample code demonstrates returning a shaped recordset and a function, PrintTbl, that displays the contents of the returned recordset. Note that the test for the field type of adChapter is to identify child recordsets for a given row. WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Microsoft does not support modifications to this code. Example
NOTE: Make sure that you change the Connect string appropriately for your system. That is, change "AdvWorks" to the name of a ODBC dsn that points to the Nwinds.MDB that comes with Visual Basic. Alternatively, create an ODBC DSN named AdvWorks that points to the Nwinds.MDB that comes with Visual Basic. REFERENCESFor additional information about shaping syntax and hierarchical recordsets, please see the following article in the Microsoft Knowledge Base: Q189657 HOWTO: Use the ADO SHAPE CommandFor a discussion of shaping and other new features in ActiveX Data Objects (ADO), please see the following Web site: http://msdn.microsoft.com/library/techart/msdn_newado20.htm Additional query words:
Keywords : kbADO200 kbDatabase kbVBp600 kbGrpVBDB kbGrpMDAC kbDSupport kbMDAC200 kbADO210sp2 |
Last Reviewed: November 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |