CdbRecordset::NextRecordset Method

Gets the next set of records, if any, returned by a multiple part select query in an OpenRecordset call, and returns a Boolean value indicating whether one or more additional records are pending (ODBCDirect workspaces only).

Syntax

BOOLNextRecordset(VOID);

Returns

A Boolean variable. TRUE indicates the next set of records is available in Recordset; FALSE indicates that no more records are pending and Recordset is now empty.

Usage

#include <afxole.h>
#include <dbdao.h>

CdbDBEngine      dben;
CdbWorkspace      ws;
CdbDatabase      dbs;
CdbRecordset      rst;
LPTSTR            szSelect =       // Two queries...
                  "SELECT LastName, FirstName "
                  "FROM Authors WHERE LastName = 'Smith';"                  "SELECT Title, ISBN FROM Titles WHERE "
                  "Pub_ID = 9999";
...
ws = dben.CreateWorkspace(...,dbUseODBC);
dbs = ws.OpenDatabase(...);
rst    = dbs.OpenRecordset(szSelect);
while( rst.NextRecordset())
{   ...            // Process each query...
   if (Error)
      rst.Cancel();
   else
      rst.Update();
   ...
}
 rst.Close();