Item Method

The Item method on a Collection object returns a specific member object of a collection by name or ordinal number. This method is supported for the Errors, Fields, and Properties collections using the OLE DB Provider for AS/400 and VSAM.

set Object = collection.Item ( Index )
 

Parameters

Index
This parameter specifies a Variant that evaluates either to the name or to the ordinal number of an object in a collection.

Return Values

An object reference from the collection.

Remarks

The Item method is used to return a specific object in a collection. If the method cannot find an object in the collection corresponding to the Index parameter, an error occurs. Also, some collections do not support named objects; for these collections, you must use ordinal number references.

The Item method is the default method for all collections; therefore, the following syntax forms are interchangeable:

collection.Item ( Index )

collection ( Index )

This method is only supported on the Errors, Fields, and Properties collections under the OLE DB Provider for AS/400 and VSAM.