SAMPLE: Cellset.exe: Using ADO MD CellSet's Item/GetItem Method in Visual C++

ID: Q242793


The information in this article applies to:
  • ActiveX Data Objects (ADO), versions 2.0, 2.1


SUMMARY

The Cellset.exe sample demonstrates how to obtain data from an ADO multidimensional (MD) query resultset by using the Visual C++ #import directive. This sample uses Microsoft OLAP Provider (MSOLAP) to create an ADO MD resultset.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

Cellset.exe
Release Date: Jan. 14, 2000

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.asp
and then click How to use the Microsoft Download Center. The Cellset.exe sample contains the following files:

File Name Size
Cellset.cpp 6.5 KB
Cellset.dsp 4.1 KB

OLAP queries return data as a multidimensional resultset. This multidimensional resultset is in the form of a Cellset object. To retrieve a cell value, you use the GetItem method of Cellset, with a safearray as a parameter.

The Cellset.exe sample shows you how to get values from Cellset by using three different methods:
  • Retrieving Data by Using Axis Numerical Position (or Cell Coordinates):

    This method retrieves data by using the coordinates of the required cell. The coordinates of the cell are passed as a safearray or VT_I4 (long) to the ICellset::get_Item method.


  • Retrieving Data by Using Ordinal Position:

    This method uses a safearray with one element of type VT_I4 (long), which specifies the Ordinal position of the value that you want to retrieve.


  • Retrieving Data by Using Member Name:

    This method passes a safearray of member names to the ICellset::GetItem method to retrieve data from the Cellset. The contents of the safearray are of type VT_BSTR (BSTR).

    NOTE: This method is not supported by the MSOLAP driver.



Compiling Cellset.exe

  1. Run the Cellset.exe file to extract the files.


  2. Open the Cellset.dsp file in Visual C++.


  3. Change the connection string and the SQL string to reflect your OLAP server's configuration.


  4. Compile this project and run the application.


Additional query words:

Keywords : kbfile kbsample kbGrpVCDB kbDSupport kbOLAP700
Version : WINDOWS:2.0,2.1
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: January 20, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.