ODBCDatabase.NextRecordSet

From Xojo Documentation

Method

ODBCDatabase.NextRecordSet() As Boolean

Supported for all project types and targets.

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 RecordSet. Not all drivers support multiple RecordSets.

Returns True if another RecordSet is available. You must execute MoveNext on the previous RecordSet to advance to the start of the next RecordSet 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 RecordSet class. When you reach the end of a record set, use NextRecordSet to initialize the next ODBC record set for processing by the RecordSet class.

Example

// 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