Subject Re: Error in Binding Cursor
Author Marco Menardi
Well, this is one of the subject I'm spending my time these days (see
some of my previous posts). I think that there is a lot of confusion
among beginners (including me) upon this subject, and I think that
should be clarified once by some "guru" in some tech sheet.
I've discovered that if the query is prepared (i.e. after an open), using:
InvalidateSQL;
Refresh;
you will not have your OnPrepareSQL code executed (but you have
BeforeOpen... yourp!)
Try it with a breakpoint on the event and you will be suprised :)
To "refresh" the query, you have to do:
Close;
InvalidateSQL;
Open;

Refresh is good only if you change parameters (or you want to have new
parameters value used when set in BeforeOpen event). But, if you have
Query.RefreshOnParamChange=True, you don't need explicit Refresh (but
you need if if you want an "up to date dataset", since the rows you
are viewing are local buffered values).

If the query takes a long time, simpli disable the checkbox control
before "refreshing" the dataset and enable it at the end (but put this
into a try..finally), so no one will change it in the meantime.

In any case, "Problem with Binding Cursor" error is out of my diagnosy
capabilities, don't know about it.
regards
Marco Menardi

--- In IBObjects@y..., "Jerry Sands" <jsands@g...> wrote:
> I am using IBO V4.2Hi. In my application I started getting "Error in
> Binding Cursor" errors. I am using "OnPrepareSQL" to make changes
to the
> where clause with "SQLWhereItems.Add". This is all triggered with a
check
> box that when clicked will do
>
> InvalidateSQL;
> Refresh;
>
> on the dataset. This works quickly and most of the time but
occasionally I
> get an error "Problem with Binding Cursor". The program cannot
continue.
> If instead I use
>
> UnPrepare;
> Prepare;
> Open;
>
> I do not get the error but this is much slower. It seems that the
failure
> comes about when the refresh takes a while to find and bring back
all the
> rows and I am able to change the check box starting the
"InvalidateSQL" and
> "Refresh" before the last refresh is completed. Apparently I cannot
"step
> on myself" when I use the "UnPrepare", "Prepare", and "Open" .
>
> Is there any way to be sure nothing is pending before calling
> "InvalidateSQL"?
>
> Jerry Sands