You can select the items of a collection by index, by sequence, by enumerator, or by name. If you get a collection for an origin object, or plan to move from an origin object to a destination object, all of these selection options are available. If you get a collection for a destination object, or plan to move from a destination object to an origin object, you have fewer selection options. The availability of a selection option is described in each approach.
You can select collection items in the following ways:
COM: Use the get_Item method of the IRelationshipCol interface or the ITargetObjectCol interface.
Automation: Use the syntax collection(index), as for any Automation collection.
This approach is valid when the origin object and the source object are the same. You cannot select by sequence from a collection belonging to a destination object, because the repository does not sequence collections belonging to destination objects.
For more information, see Using Enumerators to Work with Items in a Collection.
COM: Use the get_Item method of the IRelationshipCol interface or the ITargetObjectCol interface.
Automation: Use the syntax myCollection("name").
Note You cannot select by name from a collection belonging to a destination object, because a Microsoft® SQL Server™ 2000 Meta Data Services repository does not support the naming of origin objects.
If a name within the collection of names is not unique, the repository will return the first item that it finds with the specified name.