CubeDef Example

This code example demonstrates how to access the CubeDefs and Dimensions collections. It prints the name of each dimension in a cube. This code assumes there is a Data Source named Bobs Video Store on the OLAP server.

Dim cat     As New ADOMD.Catalog
Dim cdf     As ADOMD.CubeDef
Dim i       As Integer
cat.ActiveConnection = "Data Source=Bobs Video Store;Provider=msolap;"
Set cdf = cat.CubeDefs("Bobs Video Store")
For i = 0 To cdf.Dimensions.Count - 1
    Debug.Print cdf.Dimensions(i).Name
Next