clsCube
Ostrzeżenie
Ta funkcja zostanie usunięta z następnej wersji programu Microsoft SQL Server. Nie należy stosować tej funkcji w nowych projektach oraz jak najszybciej należy zmodyfikować aplikacje, w których obecnie jest używana ta funkcja.
Obiekt ClassType clsCube zawiera implementację MDStore interfejs biblioteki Decision Support Objects (DSO) dla modułów.Każde wystąpienie clsCube zawiera kolekcje, metody i właściwości za pomocą MDStore interfejs.
Przykład
Użyć następującego kodu, aby utworzyć obiekt moduł (oznacza to, że obiekt ClassType clsCube):
' Assume an object (dsoServer) of ClassType clsServer exists
' and contains a database in its MDStores collection
Dim dsoDB As DSO.MDStore ' Create an interface for the database.
Dim dsoCube As DSO.MDStore ' Create an interface for the cube.
' Assign the database interface to the first database
' in the server's collection of databases.
Set dsoDB = dsoServer.MDStores(1)
' Next, create the new cube by using the AddNew method
' of the database object's MDStores collection of cubes.
Set myCube = dsoDB.MDStores.AddNew("MyCube")
'Set properties and add dimensions, levels, and measures
' . . .
' Next, create a virtual cube.
Dim dsoVCube as DSO.MDStore ' Create an interface for the virtual cube.
' Use the AddNew method of the MDStores collection,
' just as before, but specify that the cube is virtual
' using the SubClassType argument sbclsVirtual.
Set dsoVCube = dsoDB.MDStores.AddNew("MyVCube", sbclsVirtual)
'Add measures, set properties, and add dimensions
Poniższy kod umożliwia utworzenie moduł połączone.Procedura ta musi obejmować dwóch różnych serwerów.Próba utworzenia łącza do moduł na tym samym wyniki z serwera błąd.
Dim dsoServer As New DSO.Server
Dim dsoDB As DSO.MDStore ' Create an interface for the database.
Dim dsoLCube As DSO.MDStore ' Create an interface for the linked cube.
Dim dsoLDS As DSO.DataSource
' Connect to the server
dsoServer.Connect "localhost"
' Get a reference for the database that
' will contain the linked cube.
Set dsoDB = dsoServer.MDStores("FoodMart")
' Create a new data source for the linked cube.
Set dsoLDS = dsoDB.DataSources.AddNew("Linked Cube")
' Set the connection string, so that the data source points
' to an Analysis server running SQL Server 2000 Analysis Services.
dsoLDS.ConnectionString = "Provider=MSOLAP;Data Source=servername; _
Initial Catalog=Foodmart;"
' Save this data source in the repository.
dsoLDS.Update
' Create a new cube on the local server, mark it as linked.
Set dsoLCube = dsoDB.MDStores.AddNew("Linked Sales", sbclsLinked)
' Add dsoLDS to the DataSources collection of the linked cube.
dsoLCube.DataSources.Add dsoLDS
' Use the name of the published cube as the
' source table for the subscribed cube.
dsoLCube.SourceTable = """" & "Sales" & """"
' Update the cube.
dsoLCube.Update
' Completely process the linked cube.
dsoLCube.Process processFull
Moduły wirtualne
Obiekt moduł z SubClassType z sbclsVirtual jest moduł wirtualnego.Virtual cubeis wykorzystywany do hermetyzacji podzbiór miary, wymiary i poziomy znajdujące się w grupie modułów.Moduł wirtualny, podobnie jak widok w relacyjnej bazie danych jest logiczną konstrukcja, która nie zawiera danych.Podobnie jak widok łączy wiele relacji, moduł wirtualny łączy wiele modułów.
Podstawowa metoda zarządzania modułów wirtualnych jest dodanie ich do bazy danych o SubClassType parametr zestaw do sbclsVirtual. następnie można dodać wymiarów i miar do ich potrzeb.Jednakże wymiarów i miar są uzyskiwane z uprzednio zdefiniowanych modułów w bazie danych, zamiast z tabela wymiarów.Wszystkie poziomy skojarzone z wymiar, który został dodany do moduł wirtualnego automatycznie stosuje się do wymiar moduł wirtualnego.Moduły wirtualne nie dotyczą partycje i agregacji.
Dodawanie lub usuwanie wymiar lub miara modułu wirtualnego, należy ponownie przetworzyć moduł wirtualny tak wpłynie na działania serwera analizy.To samo dotyczy usunięcie wymiar lub miara z modułu po przypisywanie moduł wirtualny lub usunięcie wymiar lub miara z bazy danych po przypisywanie modułu lub modułu wirtualnego.
Moduły połączone
Obiekt moduł z SubClassType z sbclsLinked jest połączony moduł.Zawartość modułu połączone są oparte na inny moduł, który jest zdefiniowany i przechowywane na innym serwerze analiz.W odróżnieniu od moduł wirtualny, który może zawierać części jednego lub więcej modułów, połączone modułu odwołuje się do całej zawartości pojedynczego modułu.
Zobacz także