Method

ODBCDatabase.NextRecordSet


Warning

This item was deprecated in version 2019r2. Please use ODBCDatabase.NextRowSet as a replacement.

Description

Determines whether more results are available on a statement containing SELECT, UPDATE, INSERT, or DELETE statements and, if so, initializes processing for those results. This method only affects the most recently opened RowSet. Not all drivers support multiple RecordSets. Returns True if another RowSet is available. You must execute MoveNext on the previous RowSet to advance to the start of the next RowSet after calling NextRecordSet.

Notes

For a command that can return multiple record sets from the ODBC database and driver, you iterate though each of them using the RowSet class. When you reach the end of a record set, use NextRecordSet to initialize the next ODBC record set for processing by the RowSet class.

Sample code

' db is a connected database
' rs contains multiple RecordSets from the ODBC database

' First RecordSet
While Not rs.EOF
  ' Process data in 1st record set
  rs.MoveNext
Wend

If db.NextRecordSet Then ' Initialize next ODBC record set (if one is available)
  While Not rs.EOF
    ' Process data in 2nd record set
    rs.MoveNext
  Wend
End If

Compatibility

All project types on all supported operating systems.