Board index » delphi » TADOTable - Filtered, sort, & Locate

TADOTable - Filtered, sort, & Locate

Hi all,

I have a Delphi front end to a MS Access 2000 db using TADOTable.  I'm
having trouble with the locate function....

Current code:
(1) Sort by FV B ASC, FV C DESC (C is a timestamp)
(2) Filter on FieldValue A = "blah"
(3) Locate FV B = "foo"

If this returns TRUE, the located record should be the one with the latest
timestamp of those with FV A = "blah" and FV B = "foo".  Instead, I get the
first of such records.  If I change the sort to FV C ASC, I *still* get the
first record, rather than the last.  Any ideas what the locate method does
when multiple records match the criteria?

Previous code:
(1) Sort by FV C ASC
(2) Filter on FV A = "blah", FV B = "foo"
(3) FindLast on the filtered dataset

This works everytime, but the code is slow when I'm iterating through values
of FV B.  My assumption is that the second procedure should be slower than
the first as I'm continously changing the filter.  Is this code (generally)
slower than the first?

Any help you all can offer would would be greatly appreciated.

Dan

 

Re:TADOTable - Filtered, sort, & Locate


Hi anonymous,

Quote
> Current code:
> (1) Sort by FV B ASC, FV C DESC (C is a timestamp)
> (2) Filter on FieldValue A = "blah"
> (3) Locate FV B = "foo"

This case is not handled correctly by ADOExpress (at least in D5).
Have a look here to TBetterADODataSet, which contains a fix for this bug as well
as other improvements to the Locate method (among others):
http://web.orbitel.bg/vassil/

Thrse

Re:TADOTable - Filtered, sort, & Locate


Hi Thrse,

How are you doing?

Quote
> This case is not handled correctly by ADOExpress (at least in D5).

Same case with D6 too.

--
Vassil Nazarov
http://web.orbitel.bg/vassil/

Re:TADOTable - Filtered, sort, & Locate


Hi Vassil,

Quote
> How are you doing?

The best I can... nice to read you.

Quote
> Same case with D6 too.

I now remember you told something about that - thanks.
Let's hope for D7 then.

Thrse

Re:TADOTable - Filtered, sort, & Locate


Quote
> Let's hope for D7 then.

Not a chance as fare as I know. The DBGO stuff has been put
in maintenance mode just as the BDE.

--
Vassil Nazarov
http://web.orbitel.bg/vassil/

Other Threads