ODBCDatabase.NextRowSet

From Xojo Documentation

Method

ODBCDatabase.NextRowSet() As Boolean

New in 2019r2

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 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 NextRowSet.

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.

Example

// db is a connected database
// rs contains multiple RowSets from the ODBC database

// First RowSet
While Not rs.AfterLastRow
// Process data in 1st record set
rs.MoveToNextRow
Wend

If db.NextRowSet Then // Initialize next ODBC record set (if one is available)
While Not rs.AfterLastRow
// Process data in 2nd record set
rs.MoveToNextRow
Wend
End If