Using ADO

Analysis Services Programming

Analysis Services Programming

Using ADO

This library contains objects that may be used to develop client applications that use PivotTable® Service. This library provides objects such as the Connection object, which provides methods such as Open, OpenSchema, and Execute. For more information, see the Microsoft® ActiveX® Data Objects (ADO) documentation.

It is not necessary to use the ActiveX Data Objects (Multidimensional) (ADO MD) library in conjunction with ADO to retrieve data from PivotTable Service. Each library can be used independently of the other. For more information, see Working with OLAP Data.

Example

The following code creates a Command object:

Dim MyCommand As New ADODB.Command
MyCommand.ActiveConnection = "Provider=msolap; Data Source=LocalHost; Initial Catalog=FoodMart 2000;"
MyCommand.CommandText = "select {[Measures].[Unit Sales]} on columns," & _
    "order(except([Promotion Media].[Media Type].members," & _
    "{[Promotion Media].[Media Type].[No Media]}),[Measures].[Unit Sales],DESC) on rows " & _
    "From Sales"
MyCommand.Execute

See Also

Using ADO MD