영어로 읽기

다음을 통해 공유


ParentObject (Command Interface)

[!참고]

  이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

The ParentObject property returns a reference to the default interface of the parent object.

Applies To:clsCubeCommand, clsDatabaseCommand, clsRoleCommand

Data Type

Object

Access

Read-only

주의

This property returns the default interface for the parent of the command object. For objects whose ClassType property is clsRoleCommand, this property returns an object of ClassType clsCubeRole or clsDatabaseRole.

The returned object and its class type depend on the class type of the current command object.

Class type

Parent object interface

Parent object class type

clsDatabaseCommand

MDStore

clsDatabase

clsCubeCommand

MDStore

clsCube

clsRoleCommand

Role

clsDatabaseRoleclsCubeRoleclsMiningModelRole

The following example compares the use of the Parent property with the ParentObject property:

Dim dsoDB As DSO.MDStore
Dim dsoRole As DSO.Role
Dim dsoRoleCmd As DSO.Command
Dim dsoDatabaseRole As DSO.Role

  dsoServer.Connect "LocalHost"
  Set dsoDB = dsoServer.MDStores("FoodMart 2000")

'Get the first role in the database.
'This should be the Everyone role.
  Set dsoRole = dsoDB.Roles(1)

  Debug.Print "DatabaseRole.Name = " & dsoRole.Name
'Add a new command to the role.
  Set dsoRoleCmd = dsoRole.Commands.AddNew("RoleCmd")
  
  'Print the properties of the Parent object.
  Debug.Print ".Parent properties" & vbCrLf & "---------"
  Debug.Print "Interface type = " & TypeName(dsoRoleCmd.Parent)
  If dsoRoleCmd.Parent.ClassType = clsDatabase Then
    Debug.Print ".ClassType = clsDatabase"
  Else
    Debug.Print "This should never be printed."
  End If
  Debug.Print ".Description = " & dsoRoleCmd.Parent.Description
  Debug.Print ".Name = " & dsoRoleCmd.Parent.Name

'Print the properties of the ParentObject object
  Debug.Print ".ParentObject properties" & vbCrLf & "---------"
  Debug.Print "Interface type = " & TypeName(dsoRoleCmd.ParentObject)
  Set dsoDatabaseRole = dsoRoleCmd.ParentObject
  If dsoDatabaseRole.ClassType = clsDatabaseRole Then
      Debug.Print ".ClassType = clsDatabaseRole"
  Else
    Debug.Print "This should never be printed."
  End If
  Debug.Print ".ClassType = " & dsoDatabaseRole.ClassType
  Debug.Print ".Description = " & dsoDatabaseRole.Description
  Debug.Print ".Name = " & dsoDatabaseRole.Name

참고 항목

참조