LevelType (Level Interface)
Remarque : |
---|
Cette fonctionnalité sera supprimée dans la prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement, et modifiez dès que possible les applications qui utilisent actuellement cette fonctionnalité. |
The LevelType property of the Level interface returns an enumeration constant that identifies the specific type of level. It tells client applications that encounter this level what kind of content the level contains.
Applies To:clsAggregationLevel, clsCubeLevel, clsDatabaseLevel, clsPartitionLevel
Data Type
Access
Access depends on the value of the ClassType property of the object.
Class type | Access |
---|---|
clsDatabaseLevel |
R/W* |
clsCubeLevel |
R |
clsPartitionLevel |
R |
clsAggregationLevel |
R |
* Read-only for virtual cube levels and for levels with a SubClassType of sbclsParentChild or sbclsMining.
Notes
The LevelType property can be set to one of the constants enumerated by the LevelTypes enumeration. If the level is part of a relational OLAP (ROLAP) dimension, the first level must be unique and must always be of type levAll. Time levels have their LevelType property set to one of the time level constants, such as levTimeYears or levTimeMonths. Time levels must be created according to the time hierarchy: For example, a level of type levTimeYears must be above a level of type levTimeMonths.
Examples
A. Setting Level Type
Use the following code to set the level type of a level object to days:
LevelObject.LevelType = levTimeDays
B. Setting and Determining Level Type
Use the following code to return the level type of a level object and to determine which level type has been returned:
'Assume an object (dsoLevel) of ClassType clsDatabaseLevel exists
Dim objType As DSO.LevelTypes
objType = dsoLevel.LevelType
Select Case objType
Case levRegular
' Commands for levRegular, a level not time-related
Case levAll
' Commands for levAll, the topmost level
Case levTimeQuarters
' Commands for levTimeQuarters, a calendar quarter level
..Case levCompany
' Commands for levCompany, a company information level
..Case levGeoCity
' Commands for levGeoCity, a city name level
Case levProduct
' Commands for levProduct, an individual products level
Case Else
' Commands for other LevelTypes
End Select