Dim conn As New adomd.AdomdConnection()
conn.ConnectionString = pt.PivotCache.Connection.ToString.Replace("OLEDB;", "") ' The PivotTables ConnectionString started with "OLEDB;" - needs to be sorted out'
' [Dimension].[Hierarchy] -> Dimension.Hierarchy'
Dim str_tmp As String = combox_search_in.Text.Replace("]", "").Replace("[", "")
Dim char_tmp As Char() = ".".ToCharArray
' Separate the two strings and put them into an array'
' 0. Name Dimension '
' 1. Name Hierarchy '
Dim strarr_dim_hier As String() = str_tmp.Split(char_tmp(0))
conn.Open()
' Iterate (simplified, filtering removed) '
For Each cube As adomd.CubeDef In conn.Cubes
For Each dimension As adomd.Dimension In cube.Dimensions
For Each hierarchy As adomd.Hierarchy In dimension.Hierarchies
For Each level As adomd.Level In hierarchy.Levels
For Each member As adomd.Member In level.GetMembers
msgbox(member.name)
Next
Next
Next
Next
Next
conn.Close()
|