Subject Re: [IBO] Att: Ramil - Filter problem with cached updates
Author Ramil

Use OnFilterRecord instead of Filter property.
And RefreshFilteredRows for applying it with CachedUpdates records.

> This method causes the dataset to walk all the records of the primary and
> secondary buffers in order to recalculate their Filtered flag.
> The OnFilterRecord event will be triggered for each row as a result of this
> call.

> This event allows each individual record to be flagged as to whether it is
> currently within or outside the filtered set. It integrates fully with all of
> the other filtering and navigation mechanisms such as Filtered, FindFirst,
> FindNext, FindPrior, FindLast, Locate(), and so on.
> New features in version 4 mean it is no longer necessary to refresh the rows
> from the server in order to re-evaluate the row's Filtered flag. The flag is
> now applied to all of the rows which remain in the buffers. If the filtering
> criteria change, it is now sufficient to call only the RefreshFilteredRows
> method. It does not involve the server at all - it just recalculates all of
> the filtered flags of the rows in the buffers.

procedure TForm1.qryDetailFilterRecord(DataSet: TDataSet;
var Accept: Boolean);
Accept:= DataSet.FieldByName('MASTER_ID').AsInteger =

Procedure TForm1.qryMasterAfterScroll(DataSet: TDataSet);
if qryDetail.Active then

This quite elegant decision IMHO.

Best regards,
Ramil khabibr@...

> Hi
> I sent this message a few weeks ago directly to Jason. When I now
> sent him a reminder (since this is causing major performance
> problems for me) about the case he replied and asked me to post it
> on the support list and notify Ramil about it.
> The example file mentioned in the message is now uploaded to the
> files area (
> - -
> Ever since I started to use IBObjects a few years ago I have been
> having problems with the combination of filtering+cached updates. It
> seems like when using cached updates filtering does not work
> correctly.
> I made a sample application with simple master/detail-queries. The
> detail query is filtered by the master querys ID in the master
> querys AfterScroll-event.
> Filtering only works for saved detail records, new records are
> always included in the filtered dataset regardless of the filter.
> Ie. in the application if you have cached updates enabled and add
> anything to the lower grid and attach it to a specific master ID the
> added detail line is visible also when scrolling up in the master
> grid to other master ID values.
> The sample project is done with Delphi 7 and a not-current version
> of IBObjects but I have also tried it with BDS2006 and IB 4.6Bc and
> the result is the same.
> This is a major problem for me. Until now I have been forced to
> execute additional work-around code so that I can continue to use
> Cached Updates (which is very crucial to the structure of our
> application) and it works but with a BIG performance hit. Now with
> increased amount of records in my customer's databases it is
> becoming unbearable.
> I have seen (on eg that
> cached updates seems to be deprecated with IBObjects. Is this the
> case or can you tell my why I can't get this simple application to
> work without turning off Cached Updates?
> - -
> Best regards,
> Kjell Ljungqvist