Cursor has not been declared

Item Value
SQLCODE -170
Constant SQLE_CURSOR_NOT_DECLARED
SQLSTATE 24W01
Sybase error code 557
ODBC 2 State 24000
ODBC 3 State 24000

Probable cause 

You attempted to OPEN a cursor that has not been declared.