Subject Re: Cursor Unknown?
Author Marco Menardi
Well, as previously suggested, the only time I had similar error was
for a transaction not started before use cursor APIFirst.
Check that the sequence is something like this:
( trsParametri is the transaction linked with the cursor
crsParamPgm is the cursor component)

if not trsParametri.Started then
trsParametri.Started := True;
crsParamPgm.APIFirst;
crsParamPgm.FieldByName('PARAMETRI').AssignTo(FParamPgm);
...

Jason suggested not to use APIFirst if you don't truly know what you
are doing, but use First instead, so you could change it also.
Also, use trsParametri.Started := True instead of StartTransaction, AFAIR.
regards
Marco Menardi


--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
> Every so often - with no apparent sequence I can track, I get an
exception
> Dynamic SQL Error code=-504, Cursor unknown.
> I get it on this line... my save point
> IB_Connection1.DefaultTransaction.Refresh(true);
>
> I can't seem to track down what causes it, or what the exception results
> in.. It does not appear to destabilise my application nor does it
appear to
> rollback any edits.. I can move off the current record and continue
> processing/editing etc with no problem.
>
> Someone mentioned that it can be caused by a IB_Cursor not having a
default
> transaction. I have gone thru all my components to check this and it
does
> not appear to be the case. I have an IB_Connection with a IB_Transaction
> component set as it's default. In some places I use an IB_Cursor
with it's
> own IB_Transaction using the application IB_Connection. That is, I
do not
> use the default (internal) transactions for either the IB_Cursor or the
> IB_Connection components. But I do use the same connection with
different
> transactions at different times.
>
> Now does anyone have any othe clues as to what this exception is all
about,
> how to avoid it r whether I should just swallow it and forget it?
> thanks
> Alan