The function to do this is SQLCancel.
Here is a simple example of its use:
- Code: Select all
// Specify that the statement is to be executed asynchronously.
SQLSetStmtAttr(hstmt1, SQL_ATTR_ASYNC_ENABLE, SQL_ASYNC_ENABLE_ON, 0);
// Execute a SELECT statement asynchronously.
while ((rc=SQLExecDirect(hstmt1,"SELECT * FROM Orders",SQL_NTS))==SQL_STILL_EXECUTING)
{
// While the statement is still executing, do something else, like sleep
if ( m_userHasPressedCancel)
{
SQLCancel(hstmt1);
return;
}
Sleep(250);
}
Im fairly new to the Poco ODBC libraries, but Ive studied the code and cant find any mention of SQLCancel or asynchronous support.
Is this being considered?





