Subject | Re: Unknown Cursor |
---|---|
Author | Marco Menardi |
Post date | 2003-03-28T13:11:21Z |
AFAIK, it happens with IB_Curstor if the transaction has not been
started before. Unlike IB_Query, IB_Cursor currently does not start
the transaction if not started, as Jason explained me in an old post,
but I don't remember if what that error raisen.
try to always start transaction before use cursors:
with dmParametri do
begin
if not trsParametri.Started then
trsParametri.Started := True;
crsParamPgm.APIFirst;
crsParamPgm.FieldByName('PARAMETRI').AssignTo(FParamPgm);
crsParamPgm.Close;
trsParametri.Commit;
end;
it was hard to find for me because that TIB_Cursor shares the
transaction component with other TIB_Query, so the order in wich the
code was executed determined the error (if a TIB_Query was used
before, it automatically started the transaction, so the subsequent
IB_Curstor did not fail).
regards
Marco Menardi
started before. Unlike IB_Query, IB_Cursor currently does not start
the transaction if not started, as Jason explained me in an old post,
but I don't remember if what that error raisen.
try to always start transaction before use cursors:
with dmParametri do
begin
if not trsParametri.Started then
trsParametri.Started := True;
crsParamPgm.APIFirst;
crsParamPgm.FieldByName('PARAMETRI').AssignTo(FParamPgm);
crsParamPgm.Close;
trsParametri.Commit;
end;
it was hard to find for me because that TIB_Cursor shares the
transaction component with other TIB_Query, so the order in wich the
code was executed determined the error (if a TIB_Query was used
before, it automatically started the transaction, so the subsequent
IB_Curstor did not fail).
regards
Marco Menardi
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
> Does anyone know what an occasional exception of "unknown cursor"
means? Any
> clues as to tracking the cause down?
> thanks
> Alan