SQLFreeStmt in the Cursor Library

If an application calls SQLFreeStmt with the SQL_UNBIND option after it calls SQLExtendedFetch, SQLFetch, or SQLFetchScroll, the cursor library returns an error. Before it can unbind result set columns, an application must call SQLCloseCursor or SQLFreeStmt with the SQL_CLOSE option.