CdbRecordset::Cancel Method

Cancels execution of a pending asynchronous method call (ODBCDirect workspaces only).

Syntax

VOIDCancel(VOID);

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();