Subject "Statement has already assigned 1 cursor" error - The fix
Author m. Th.

The bug "Statement has already one cursor assigned error." - SF ID: 2789922

still exists in 4.9.3. However I found a fix for it:

In IB_Components.Pas we have

function TIB_BDataset.SysLookupKeyForBufferFields(
ANodeRef: TIB_NodeRef ):

errcode := isc_dsql_set_cursor_name( @status,

CursorName ),
0 );

the above isc_dsql_set_cursor_name call is around of line no 34625 (but
is possible to be different in your sources).

The problem is that (at least) IntToStr returns an Unicode string which
can have #0. So we must change to:

cName:=IntToStr(cardinal(FSeekCursor))+ CursorName;

errcode := isc_dsql_set_cursor_name( @status,
0 );

...where cName is a local AnsiString (IOW cName: AnsiString)

There are other bugs in TDataSet-compatible (TIBO) layer but I cannot
(for the time being) do a simple test case for them.


m. Th.