Code: Select all
if FCommand.FSQLType = SQL_SELECT_FOR_UPD then
Res := GDS.isc_dsql_free_statement(FCommand.FStatusVector, FCommand.FStmtHandle, DSQL_close);
{A cursor only needs to be closed in this manner if it was previously opened and associated with stmt_handle by isc_dsql_set_cursor_name().
http://docwiki.embarcadero.com/InterBase/XE7/en/Isc_dsql_free_statement()}
If I put that "if FCommand.FSQLType..." line in comment, it works but...