Overview
Features
Download
Documentation
Community
Add-Ons & Services

ODBC - SQLCancel and asynchronous calls

A general discussion forum.
frankeden
Posts: 3
Joined: 07 Nov 2011, 23:55

ODBC - SQLCancel and asynchronous calls

Postby frankeden » 08 Nov 2011, 00:04

In recent versions of ODBC, it has become possible to cancel a long running operation.
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?

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest