Partager via


Item (clsCollection)

Notes

  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 Item method of a Decision Support Objects (DSO) collection returns an instance of an item in the collection. This method does not apply to CustomProperties collections.

Syntaxe

Set vnt = object.Item(vntIndexKey)

Paramètres

  • vnt
    A Variant variable that receives the instance of the member. Instead of a variant, you can use a variable that has been declared to match the object being retrieved from the collection. For example, a variable declared as type MDStore, with its ClassType property value set to clsCube, can be used to retrieve an object from an MDStores collection of clsCube objects.

  • object
    An instance of a DSO collection object.

  • vntIndexKey
    Can be either the index (integer) or key (string) to the collection.

    Notes

      All collections in the DSO object model are one-based. That is, the first item in the collection has an index of 1 and the last item has an index of Count.

Exemple

Use the following code to return the partition named EastCoast from the MDStores collection of partitions for a cube:

' Assume the existence of an object cubCube
' of ClassType clsCube.
Dim Temp_Partition As MDStore 
' Retrieve using the key
Set Temp_Partition = cubCube.MDStores.Item("EastCoast") 
' OR Retrieve using the Index
Set Temp_Partition = cubCube.MDStores.Item(2) 
 

Voir aussi

Référence