This is new functionality for the Sybase ASE ODBC Driver 5.00.0022 and the Sybase ASE OLE DB Provider 2.70.0038. The products now support asynchronous communications as specified in the ODBC 3.5 specification.
If the TDS ODBC driver’s Cursor Mode (Select Method) is set to Cursor, the driver indicates through SQLGetInfo that it supports connection level asynchronous support. Calling SQLGetInfo with the information type of SQL_ASYNC_MODE returns an SQL_AM_CONNECTION.
If the TDS ODBC driver’s Cursor Mode is set to Direct, the driver indicates through SQLGetInfo that it supports statement level asynchronous support. Calling SQLGetInfo with the information type of SQL_ASYNC_MODE returns an SQL_AM_STATEMENT.
The TDS ODBC driver indicates through SQLGetInfo a specific limit of one (1) to the number of concurrent asynchronous statement. Calling SQLGetInfo with the information type of SQL_MAX_ASYNC_CONCURRENT_STATEMENTS returns one (1).
If the TDS ODBC driver’s cursor mode is set to Cursor, the TDS driver enables asynchronous communications support by calling the SQLSetConnectAttr. Calling SQLSetConnectAttr with the attribute value SQL_ATTR_ASYNC_ENABLE set to SQL_ASYNC_ENABLE_ON turns on asynchronous support. Making a SQLSetConnectAttr call with the attribute value SQL_ATTR_ASYNC_ENABLE set to SQL_ASYNC_ENABLE_OFF turns off asynchronous support.
If the TDS driver’s cursor mode is set to Direct, the TDS driver will enable asynchronous communications support by calling the SQLSetStmtAttr. Calling SQLSetStmtAttr with the attribute value SQL_ATTR_ASYNC_ENABLE set to SQL_ASYNC_ENABLE_ON will turn on asynchronous support. Making a SQLSetStmtAttr call with the attribute value SQL_ATTR_ASYNC_ENABLE set to SQL_ASYNC_ENABLE_OFF will turn off asynchronous support.
The following ODBC functions can be supported asynchronously:
SQLBulkOperations
SQLColAttribute
SQLColumnPrivileges
SQLColumns
SQLCopyDesc
SQLDescribeCol
SQLDescribeParam
SQLExecDirect
SQLExecute
SQLFetch
SQLFetchScroll
SQLForeignKeys
SQLGetData
SQLGetDescField
SQLGetDescRec
SQLGetDiagField
SQLGetDiagRec
SQLGetTypeInfo
SQLMoreResults
SQLNumParams
SQLNumResultCols
SQLParamData
SQLPrepare
SQLPrimaryKeys
SQLProcedureColumns
SQLProcedures
SQLPutData
SQLSetPos
SQLSpecialColumns
SQLStatistics
SQLTablePrivileges
SQLTables
While any of these functions are executing asynchronously they will return a SQL_STILL_EXECUTING return code. Once the given function ends, it will return the code it would have returned had it been executed asynchronously, such as SQL_SUCCESS, SQL_ERROR, or SQL_NEED_DATA.
Once asynchronous communications has been enabled, the TDS driver will execute the functions specified above asynchronously as detailed in the ODBC 3.5 specification. Once asynchronous communications is disabled, all functions will execute asynchronously. All other processing will operate as normally.