Object collections can be retrieved at both the COM and Automation level.
To retrieve a relationship, first declare a variable as an object that implements the ITargetObjectCol interface. Next, set the variable equal to the object member that is the collection you want to retrieve.
Note All collections in a Microsoft® SQL Server™ 2000 Meta Data Services repository are attached to repository objects as members.
For example, the following Microsoft Visual Basic® code retrieves a collection of bugs (a target object collection) discovered by a particular person into the variable called BugCollection:
DIM BugCollection As ITargetObjectCol
DIM Person As RepositoryObject
REM Retrieve the source object into the Person variable
Set BugCollection = Person.bugs
In this example, BugCollection(1) can refer to the first object in the collection.
To retrieve a relationship, you can perform the following steps: