I expect you are correct, and the solution may be a custom grid or data
link which flushes it's buffers to the grid or perhaps has but a single
buffer.

Indeed it is precisely the "wait until all records are in" approach which
I wish to circumvent, as the pause between finding one record and the next
may be long. The user has no idea whether the system is finding what they
want until the entire database is scanned.

The database is proprietary, the component is a custom flavour of TTable.
TQuery is not available.

This is a case of finding a non-keyed non-index string in any field. It
will be slow, becase nothing is known beforehand, and a brute force search
is required. Every record is examined in turn.

If the grid were to populate "in real time" the user could easily see
"Okay it found something at customer G, that isn't what I'm looking for,
but maybe it is further in the file, and I am at the Gs now, so I can wait
another bit".  Or "Wow it is finding the wrong stuff, stop it".

I was looking for a quicky solution like Application.ProcessMessages after
each successful find.

I guess I can indicate "searching X of ZZZZZZZZ" and at least they'd know
it was doing something...

Appreciate the comments thank you.
I can at least convince myself I haven't overlooked anything obvious.





> AFAIK, the TDBGrid and TDataSet are interacting correctly - TDataSet
buffers the records it contains in memory, and won't make them available
until all records are in, so to speak.
>
> On a different approach... by TDataSet, do you mean a TTable? You might
try a TQuery instead; depending on the database you're using, and what
it is you're trying to achieve, it might be an appropriate solution for
you. What exactly are you using as a database, and how does the user
interact with the grid in your application?
>
> [EMAIL PROTECTED] wrote:
>> Delphi 5.
>> Have a TDBGrid attached to a TDataset.
>> The dataset has a custom filter ie
>> procedure TForm1.OnFilterRecord(DataSet: TDataSet; var Accept:
>> Boolean); ...
>> Sometimes, the filter will only pick out a handful of records from a large
>> dataset. Say 7 records.
>> I notice the grid does not display any entries until all 7 have been found
>> (the grid contains more than 7 rows). To find all 7, the entire file
has
>> been scanned.
>> Is there a way to update the grid immediately: as soon as
OnFilterRecord
>> has returned Accept=true ?
>> That is, the grid would populate rows (plop, plop, plop) as the entire
file was scanned and each of the records found. The user could then
CANCEL
>> when they saw their record come up. Instead of waiting for the entire file
>> to be filtered/scanned.
>> Dataset.Refresh starts the while process over again: that is not what I
want.
>> Feels like I want a "grid.refresh" method: an
>> Application.ProcessMessages
>> sort of thing, to ensure the grid is actually displaying the record which
>> I know has just been accepted in OnFilterRecord.
>> Is there a trick, or am I deluding myself, and should take a different
approach... ?
>> Many thanks in advance.
>
>
>
> [Non-text portions of this message have been removed]
>
>




Reply via email to