Введение в OLAP

Листинг 1

Private Sub Command1_Click()  
 Dim Nod, Nod1  As Node, i, j, k, l As Integer  
 Dim Cat As New ADOMD.Catalog  
 Dim Cnn As New ADODB.Connection  
 Cnn.ConnectionString = "Provider=MSOLAP.2;Persist Security Info=True;”_  
 +”User ID=sa;Data Source=MAINDESK;Initial Catalog=NorthWind_OLAP"  
 Cnn.Open  
 Set Cat.ActiveConnection = Cnn  
 If Cat.CubeDefs.Count > 0 Then  
  Set Nod = TreeView1.Nodes.Add(, , "Catalog", "Catalog")  
  For i = 0 To Cat.CubeDefs.Count - 1  
   Set Nod1 = TreeView1.Nodes.Add("Catalog", tvwChild, _  
   Cat.CubeDefs(i).Name, Cat.CubeDefs(i).Name)  
   For j = 0 To Cat.CubeDefs(i).Dimensions.Count - 1  
    Set Nod1 = TreeView1.Nodes.Add(Cat.CubeDefs(i).Name, tvwChild, _  
    Cat.CubeDefs(i).Dimensions(j).UniqueName, _     
    Cat.CubeDefs(i).Dimensions(j).UniqueName)  
    For k = 0 To (Cat.CubeDefs(i).Dimensions(j).Hierarchies.Count - 1)  
     For l = 0 To _  
     (Cat.CubeDefs(i).Dimensions(j).Hierarchies(k).Levels.Count - 1)  
      Set Nod1 = _     
      TreeView1.Nodes.Add(Cat.CubeDefs(i).Dimensions(j).UniqueName,_  
      tvwChild, _  
      Cat.CubeDefs(i).Dimensions(j).Hierarchies(k).Levels(l).UniqueName,_  
      Cat.CubeDefs(i).Dimensions(j).Hierarchies(k).Levels(l).UniqueName)  
     Next l  
    Next k  
   Next j  
  Next i  
  Command1.Enabled = False  
 End If  
End Sub  

возврат

Наш канал на Youtube

1999 1 2 3 4 5 6 7 8 9 10 11 12
2000 1 2 3 4 5 6 7 8 9 10 11 12
2001 1 2 3 4 5 6 7 8 9 10 11 12
2002 1 2 3 4 5 6 7 8 9 10 11 12
2003 1 2 3 4 5 6 7 8 9 10 11 12
2004 1 2 3 4 5 6 7 8 9 10 11 12
2005 1 2 3 4 5 6 7 8 9 10 11 12
2006 1 2 3 4 5 6 7 8 9 10 11 12
2007 1 2 3 4 5 6 7 8 9 10 11 12
2008 1 2 3 4 5 6 7 8 9 10 11 12
2009 1 2 3 4 5 6 7 8 9 10 11 12
2010 1 2 3 4 5 6 7 8 9 10 11 12
2011 1 2 3 4 5 6 7 8 9 10 11 12
2012 1 2 3 4 5 6 7 8 9 10 11 12
2013 1 2 3 4 5 6 7 8 9 10 11 12
Популярные статьи
КомпьютерПресс использует