Subject | Re: Refreshing parameterised IB_Query when params change |
---|---|
Author | Marco Menardi <mmenaz@lycosmail.com> |
Post date | 2003-02-23T14:47:41Z |
Well, refresh does open the query if you set "RefreshAction" to
raOpen, but this does not solve complitely the problem, since I often
user refresh for "refreshing" the grid content, and I need
raKeepDataPos, and when some conditions change (i.e. fiscal year) I
need to "refresh" the dataset in the way the new parameters are taken
in the query.
In addition, would be good if my suggested "very refresh" could have a
look at the OnPrepareSQL event and, if code is present, invalidate the
query so that code will be executed.
I think that IBO can easely be improved and optimized with this new
method, since can be checked if RefreshAction is already to raOpen and
if OnPrepareSQL has code linked, and take the necessary actions
minimizing overhead (i.e. if RefreshAction = raOpen and no code for
OnPrepareSQL -> simply Refresh, if RefreshAction <> raOpen and no
code for OnPrepareSQL, close + open (only if already open? Maybe
adding a parameter defaulted to true), and if RefreshAction <> raOpen
and teher is code for OnPrepareSQL, Close, InvalidateSQL, Open (only
if already open?).
Any comment / suggestion / opinion / volunteer?
thanks
Marco Menardi
--- In IBObjects@yahoogroups.com, "Marco Menardi <mmenaz@l...>"
<mmenaz@l...> wrote:
raOpen, but this does not solve complitely the problem, since I often
user refresh for "refreshing" the grid content, and I need
raKeepDataPos, and when some conditions change (i.e. fiscal year) I
need to "refresh" the dataset in the way the new parameters are taken
in the query.
In addition, would be good if my suggested "very refresh" could have a
look at the OnPrepareSQL event and, if code is present, invalidate the
query so that code will be executed.
I think that IBO can easely be improved and optimized with this new
method, since can be checked if RefreshAction is already to raOpen and
if OnPrepareSQL has code linked, and take the necessary actions
minimizing overhead (i.e. if RefreshAction = raOpen and no code for
OnPrepareSQL -> simply Refresh, if RefreshAction <> raOpen and no
code for OnPrepareSQL, close + open (only if already open? Maybe
adding a parameter defaulted to true), and if RefreshAction <> raOpen
and teher is code for OnPrepareSQL, Close, InvalidateSQL, Open (only
if already open?).
Any comment / suggestion / opinion / volunteer?
thanks
Marco Menardi
--- In IBObjects@yahoogroups.com, "Marco Menardi <mmenaz@l...>"
<mmenaz@l...> wrote:
> Reading this list I've learned that a convenient place where put
> parameter assignment of a IB_Query is in the BeforeOpen event.
> The problem is that when the param values have to be changed, a
> refresh (or RefreshAll) does not fire the BeforeOpen, so I have to
> close/open the query (2 lines of code... too many, I'm lazy).
> Is there another method (a sort of "very refresh") or a better event
> (BeforeRefresh?) where centralize parameter assignment?
> Thanks a lot
> Marco Menardi