LevelType (Level Interface)

注意注意

  下一版本的 Microsoft SQL Server 将删除该功能。 请不要在新的开发工作中使用该功能,并尽快修改当前还在使用该功能的应用程序。

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

LevelTypes

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.

注释

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

请参阅

参考