ICommand::Cancel

OLE DB Programmer's Reference

Cancels the current command execution.

HRESULT Cancel();

Parameters

None.

Return Code

S_OK
The method succeeded.

The command was not executing.

E_FAIL
A provider-specific error occurred.
DB_E_CANTCANCEL
The executing command cannot be canceled.

Comments

ICommand::Cancel may be called on a separate thread after ICommand::Execute has been called and before the method has returned. If the executing command can be canceled, the method returns S_OK and Execute returns DB_E_CANCELED. If the executing command cannot be canceled, Cancel returns DB_E_CANTCANCEL and Execute continues. If the Execute method has not been called or has already returned, the method returns S_OK.

If the DBPROPVAL_ASYNCH_INITIALIZE bit in the DBPROP_ROWSET_ASYNCH property has been set prior to execution of the command, ICommand::Execute may return with DB_S_ASYNCHRONOUS before the command has fully executed. Calling ICommand::Cancel after the Execute method has returned has no effect on any asynchronously executing commands. Once the Execute method has returned DB_S_ASYNCHRONOUS, the command can be canceled only by calling IDBAsynchStatus::Abort on the returned object.

See Also

ICommand::Execute

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net