Cube Query and Result Set Manipulation
Sample code for creating and manipulating a query-based cube is provided in five different samples. Each sample illustrates a different implementation, depending on the development tool and whether the cube is created by a client application or a server application.
Sample Programs
The following table provides the names of and details about the samples in this section. For more information about installation and general requirements, see Analysis Services Programming Samples.
Sample | Description |
---|---|
AspAdoSimple | This Microsoft® Visual Basic® Scripting Edition (VBScript) sample executes a Multidimensional Expressions (MDX) query using the Sales cube on the local computer and displays the results in a simple table format. The sample demonstrates the basic steps for querying a database and displaying the results.
This sample requires Microsoft Internet Information Server 4.0 or Microsoft Internet Information Services (IIS) 5.0 or later, ADO, and ADO MD. This sample is located in the AspAdoSimple folder. It consists of the AspAdoSimple.asp file. |
AspAdoComplex | This VBScript sample executes an MDX query using the server, database, and cube the user specifies in fields of the form provided by an Active Server Pages (ASP) page. The sample uses the HTML COLSPAN attribute to present the resulting cellset as a table on the same HTML pane as the form.
This sample requires IIS 4.0 or later, Microsoft ActiveX® Data Objects (ADO), and ADO Multidimensional (ADO MD). This sample is located in the AspAdoComplex folder. It consists of the AspAdoComplex.asp file. |
VbAdoSimple | This Visual Basic project executes a query using ADO MD. The sample displays the result set in the Immediate window.
This sample requires Visual Basic 5.0 (with Service Pack 3) or Visual Basic 6.0, and ADO MD. This sample is located in the VbAdoSimple folder. It consists of the FrmVbAdoSimple.frm, VbAdoSimple.vbp, and VbAdoSimple.vbw files. |
VbAdoComplex | This VBScript sample executes an MDX query. The sample displays the resulting cellset in a Microsoft Excel spreadsheet.
This sample requires Visual Basic 5.0 (with Service Pack 3) or Visual Basic 6.0, ADO, and Excel. This sample is located in the VbAdoComplex folder. It consists of the FrmVbAdoComplex.frm, VbAdoComplex.vbp, and VbAdoComplex.vbw files. |
CppOlapDemo | This Microsoft Visual C++® project creates a server-side cube based on a query, using OLE DB for OLAP to connect to Microsoft SQL Server™ 2000 Analysis Services.
This sample requires Visual C++ 5.0 or later, Msmd.h (which is located in the C:\Program Files\Microsoft Analysis Services\Samples\Include folder), and the Microsoft Data Access Software Development Kit (SDK) version 2.1 or later. This sample is located in the CppOlapDemo folder. It consists of the OLAPApp.cpp, OLAPDemo.cpp, OLAPTab.cpp, OLAPDemo.dsp, OLAPApp.hpp, and OLAPTab.hpp files. |