The ODBC driver currently allows the user to bypass ODBC state check for open cursors. According to the standard an invalid cursor state (24000) error should be returned for API calls that may generate a result set or requires an open cursor to exist.
For example, when calling SQLExecDirect when a cursor is open an error should be returned and the SQLSTATE set to 24000.
Similarly, calling SQLDescribeCol when there is no result set should cause an Invalid cursor state
error. In some situations ODBC Driver Manager generates this error and in other cases
the driver returns this error.
ODBC driver has a DSN option StCheckLevel=[0 | 1 | 2] to control this behavior: