SQLCloseCursor returns SQLSTATE 24000 (Invalid cursor state) if no cursor is open. Calling SQLCloseCursor is equivalent to calling SQLFreeStmt with the SQL_CLOSE option, with the exception that SQLFreeStmt with SQL_CLOSE has no effect on the application if no cursor is open on the statement, while SQLCloseCursor returns SQLSTATE 24000 (Invalid cursor state).
Note |
|---|
| If an ODBC 3.x application working with an ODBC 2.x driver calls SQLCloseCursor when no cursor is open, SQLSTATE 24000 (Invalid cursor state) is not returned, because the Driver Manager maps SQLCloseCursor to SQLFreeStmt with SQL_CLOSE. |
For more information, see Closing the Cursor.