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



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.0
  • ActiveX Data Objects (ADO) 2.1
  • ActiveX Data Objects (ADO) 2.5
  • ActiveX Data Objects (ADO) 2.6
  • ActiveX Data Objects (ADO) 2.7

This article was previously published under Q242793

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:
Release Date: Jan. 14, 2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The Cellset.exe sample contains the following files:

File NameSize
Cellset.cpp6.5 KB
Cellset.dsp4.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.

Modification Type:MinorLast Reviewed:8/9/2004
Keywords:kbdownload kbfile kbhowto kbSample KB242793 kbAudDeveloper