Cancels execution of a pending asynchronous (that is, the method was invoked with the dbRunAsync option) Execute method call (ODBCDirect workspaces only). Cancel will return a run-time error if dbRunAsync was not used in the method you're trying to terminate.
Syntax
VOIDCancel(VOID);
Usage
#include <afxole.h>
#include <dbdao.h>
CdbQueryDef qd;
CdbConnection conn;
LPCTSTR lpctsrSQL =
_T("SELECT SALARY FROM EMPLOYEES ")
_T("WHERE LASTNAME = 'SMITH'");
...
qd = conn.CreateQueryDef(_T("SALARYDEF"), lpctsrSQL);
qd.Execute(dbRunAsync);
...
if (Error) qd.Cancel();