Asynchronous execution for ODBC

By default, drivers execute ODBC functions synchronously. That is, the application calls a function and the driver returns control to the application when execution is complete. With asynchronous execution, the driver returns control to the application after minimal processing and before execution is complete. This allows the application to execute in parallel other functions while the first function is still executing. Asynchronous execution is beneficial when a task is complex and requires a significant amount of time to execute.

For more information on asynchronous execution and its application, refer to MSDN ODBC Programmer’s Reference.

NoteThe ASE ODBC Driver by Sybase supports a maximum of one concurrent statement in asynchronous mode. Only one concurrent statement, synchronous or asynchronous, can be executed if server-side cursors are used or if the connection’s auto-commit is disabled.

To use connection-level asynchronous execution with the ASE ODBC Driver by Sybase, call SQLSetConnectAttr and set SQL_ATTR_ASYNC_ENABLE to SQL_ASYNC_ENABLE_ON.

NoteCalling SQLCancel when no processing is being done will not close the associated cursors. ODBC applications should explicitly call SQLFreeStmt or SQLCloseCursor to close cursors.