Next Method

DTS Programming

DTS Programming

Next Method

The Next method fetches the next object while iterating through the associated collection.

Applies To
PackageInfos Collection StepLineages Collection
PackageLineages Collection StepLogRecords Collection
PackageLogRecords Collection  
Syntax

Set object = collection.Next

Part Description
collection Expression that evaluates to a collection in the Applies To list
object Reference to next object in collection

Remarks

The object associated with each collection type is specified in this table.

Collection Associated object C/C++ interface
PackageInfos Collection PackageInfo Object IDTSPackageInfo
PackageLineages Collection PackageLineage Object IDTSPackageLineage
PackageLogRecords PackageLogRecord Object IDTSPackageLogRecord
StepLineages Collection StepLineage Object IDTSStepLineage
StepLogRecords Collection StepLogRecord Object IDTSStepLogRecord
TaskLogRecords Collection TaskLogRecord Object IDTSTaskLogRecord

Iterate through a collection by checking the EOF property after calling the Next method. If EOF is True, Next will have returned Nothing and all of the elements will have been fetched. In Microsoft® Visual Basic® this looks like:

   Set object = collection.Next
   Do Until collection.EOF 
      . . .
      Set object = collection.Next
   Loop

The collections in the Applies To list can also be processed using For Each ... Next in Visual Basic:

   For Each object In collection
      . . .
   Next object
Prototype (C/C++)

HRESULT Next(interface **pRetVal);

interface is as defined in the above table.

See Also

EOF Property

Retrieving DTS System, Package, and Log Data