IRelationshipCol::Remove

Meta Data Services Programming

Meta Data Services Programming

IRelationshipCol::Remove

This method deletes a relationship from its relationship collection. The exact behavior of this method depends on whether the relationship collection is an origin collection or a destination collection.

If the relationship collection is an origin collection, this method deletes the versioned relationship.

If the relationship collection is a destination collection, this method first performs object-version resolution to yield a single target-object version, and then it removes that target-object version from the TargetVersions collection of the relationship.

HRESULT Remove(
VARIANT   
sItem
);

Parts

sItem

[in]
Identifies the item to be removed from the collection. This parameter can be either the index or the name associated with the item.

Return Value

S_OK

The method completed successfully.

Error Values

This method failed to complete successfully.

Remarks

A relationship can be removed by name only if it is a unique-naming relationship.

If the source is the origin, the origin version must be unfrozen.

If the relationship is a destination relationship and the resolution strategy yields a target object version that is frozen, this method fails.

Removing an item from a sequenced collection does not update the collection sequence order.

See Also

IRelationshipCol Interface