Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread OnFilterRecord
Mon, May 12 2008 2:19 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

I've been playing with the OnFilterRecord event and I'm 95% impressed. So far I've tried a mix of a filter and the event and purely using the event


procedure TForm1.ContactsFilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
if not Q2.Prepared then Q2.Prepare;
Q2.Close;
Q2.ParamByName('ContactID').AsInteger := Contacts.FieldByName('_ID').AsInteger;
Q2.Open;
Accept := Q2.Locate('_fkContacts',Contacts.FieldByName('_ID').AsInteger,[]) ;
Q2.Close;
end;

Q2.......
SELECT _fkCompanies,_fkContacts,_Forename,_Surname FROM Contacts
JOIN Career ON _ID = Career._fkContacts
WHERE
_ID = :ContactID
AND
(_Surname like 'A%' or _Surname like 'W%' or _Surname like 'M%')
AND
Career._fkCompanies = 107403

The 5% I'm not impressed with is what happens if you try and cursor below the last record in a DBGrid - c5secs before things start working again and I can cursor upwards.

Roy Lambert
Tue, May 13 2008 11:33 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< The 5% I'm not impressed with is what happens if you try and cursor below
the last record in a DBGrid - c5secs before things start working again and I
can cursor upwards. >>

This may be the case, especially if there's a large gap between the last row
displayed and the next valid row according to your OnFilterRecord event
handler.   The OnFilterRecord works on the basis of an ordered row scan, so
it has to physically keep scanning until your event handler says that it
found a valid row.  You can count for yourself how many rows are scanned in
that 5 seconds in your OnFilterRecord event handler.  My guess is that it is
quite a few.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, May 13 2008 1:18 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>This may be the case, especially if there's a large gap between the last row
>displayed and the next valid row according to your OnFilterRecord event
>handler. The OnFilterRecord works on the basis of an ordered row scan, so
>it has to physically keep scanning until your event handler says that it
>found a valid row. You can count for yourself how many rows are scanned in
>that 5 seconds in your OnFilterRecord event handler. My guess is that it is
>quite a few.

I refuse to sit and watch invisible rows go past Smiley

I need to try a few more tests but my initial reaction is that the 5% is very livable with.

Roy Lambert
Thu, May 15 2008 10:30 PMPermanent Link

Jeff Dunlop
I've always implemented this type of method with an enumerated type that returns good, bad, toolow and toohigh.
Fri, May 16 2008 4:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jeff

>I've always implemented this type of method with an enumerated type that returns good, bad, toolow and toohigh.

This sounds like it should be interesting - can you expand please.

Roy Lambert
Image