The information in this article applies to:
SUMMARY
The ATLShape.exe sample demonstrates how to retrieve hierarchical data by using the MSDataShape provider. The sample reads data from either a Microsoft Access 97 database or a SQL Server 7.0 database, and writes it to an Example.out text file. MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: ATLShape.exeRelease Date: For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. The ATLShape.exe file contains the following files:
The ATLShape.exe sample allows the user to read from either the Access 97 Test.mdb database or from a local SQL Server 7.0 Northwind database. The hierarchical output is written to an Example.out text file. This is achieved by setting up an appropriate connection string for each:
ATLShape also creates a CMyRowset class that is derived from the CRowset class. The CRowset class is provided by ATL OLE DB template libraries, which provide the ability to perform hierarchical queries. This class maintains an m_hChapter HCHAPTER variable that stores the HCHAPTER data type of the chaptered column in the parent that is currently being accessed.The child rowset is obtained by performing an IRowsetInfo::GetReferencedRowset method on the chaptered column as follows:
In addition, an ATLOutputData template function is provided that reads data from class rowsetClass and writes it to the FILE* that is passed to it:
To retrieve data from the chaptered column, perform the following steps:
Steps to Run the Application
Additional query words:
Keywords : kbfile kbsample kbATL210 kbDatabase kbOLEDB210 kbVC600 kbGrpVCDB kbDSupport |
Last Reviewed: January 14, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |