Parent (Command Interface)

注意注意

  この機能は、Microsoft SQL Server の次のバージョンで削除されます。 新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションはできるだけ早く修正してください。

The Parent property of the Command interface contains a reference to the parent MDStore object of which this object is a child.

Applies To:clsCubeCommand, clsDatabaseCommand, clsRoleCommand

Data Type

MDStore

Access

Read-only

説明

The class of the parent object depends on the class of the command object.

Command object class

Parent object class

clsDatabaseCommand

clsDatabase

clsCubeCommand

clsCube

clsRoleCommand

clsCubeRoleclsDatabaseRoleclsMiningModelRole

使用例

The following example creates a cube command and assigns it to the first cube in the MDStores collection of the FoodMart 2000 database. It then prints some of the properties of the parent object by using the Parent property of the cube command object.

Dim dsoServer As New DSO.Server
Dim dsoDB As DSO.MDStore
Dim dsoCube As DSO.MDStore
Dim dsoDBCmd As DSO.Command
Dim dsoCubeCmd As DSO.Command

' Connect to the Analysis server.
    dsoServer.Connect "LocalHost"

' Get a reference to the FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")

' Get the first cube in the database's collection.
    Set dsoCube = dsoDB.MDStores(1)
    Debug.Print "Cube.Name = " & dsoCube.Name

' Add the command to the cube's collection.
    Set dsoCubeCmd = dsoCube.Commands.AddNew("TempCommand")
    Debug.Print "Cube.Commands(""TempCommand"").Name =" & _
        dsoCube.Commands("TempCommand").Name

' Print the properties of the command's 
' Parent object.
    Debug.Print "   .Parent properties" & vbCrLf & _
        "   -----------"
    Debug.Print "   TypeName(dsoCubeCmd.Parent) = " & _
        TypeName(dsoCubeCmd.Parent)
    If dsoCubeCmd.Parent.ClassType = clsCube Then
        Debug.Print "   .ClassType = clsCube"
    Else
        Debug.Print "This line should never be executed."
    End If
    Debug.Print "   .Description = " & dsoCubeCmd.Parent.Description
    Debug.Print "   .Name = " & dsoCubeCmd.Parent.Name

    dsoCube.Commands.Remove ("TempCommand")

関連項目

参照