OrdinalPosition (Command Interface)
[!참고]
이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.
The OrdinalPosition property of the Command interface contains the ordinal position of a command in the Commands collection in the parent MDStore object.
Applies To:clsCubeCommand, clsDatabaseCommand, clsRoleCommand
Data Type
Integer
Access
Read-only
주의
Ordinal position determines the order in which commands are executed. This order is important when one command depends on another command (for example, a CREATE SET command that uses a member defined in a CREATE MEMBER command). In this case, the CREATE MEMBER command should have a lower OrdinalPosition property value than the CREATE SET command. However, the ordinal position of the command does not affect the solve order of the calculated member or calculated cells definition the command may create. For more information on how solve order affects calculated cells and calculated members, see Understanding Pass Order and Solve Order.
예
The following code creates three new commands in the Commands collection of the FoodMart 2000 database. It then enumerates the collection, printing the OrdinalPosition and Name properties to the Debug window. Then, the code example deletes and re-creates the first command, and again enumerates the collection to demonstrate the change in ordinal position on the other commands.
Dim dsoServer As New DSO.Server
Dim dsoDB As DSO.MDStore
Dim dsoCmd As DSO.Command
' Connect to the local Analysis server.
dsoServer.Connect "LocalHost"
' Open the FoodMart 2000 database.
Set dsoDB = dsoServer.MDStores("FoodMart 2000")
' Add three sample commands.
Set dsoCmd = dsoDB.Commands.AddNew("Command3")
Set dsoCmd = dsoDB.Commands.AddNew("Command1")
Set dsoCmd = dsoDB.Commands.AddNew("Command2")
' Iterate through the commands for the database.
For Each dsoCmd In dsoDB.Commands
' Print its name and ordinal position
Debug.Print dsoCmd.OrdinalPosition & " = " & dsoCmd.Name
Next
' Now, delete the Command3 command and add it again.
dsoDB.Commands.Remove "Command3"
Set dsoCmd = dsoDB.Commands.AddNew("Command3")
' Iterate again through the commands for the database.
Debug.Print "-----"
For Each dsoCmd In dsoDB.Commands
' Print its name and ordinal position
Debug.Print dsoCmd.OrdinalPosition & " = " & dsoCmd.Name
Next