Board index » delphi » Locate and Filter on TADOTable

Locate and Filter on TADOTable

Hi,

there seems to be an error in the Locate method of TADOTable when you
have a Filter set. I have Filtered=True and an OnFilter event.

I try to locate a StringField with the options [loCaseInsensitive,
loPartialKey].

Now if the first record, that matchs the partial search doesnt match
the filter then I get a "record not found" error.

The problem is somewhere in TCustomADODataSet.GetRecord with GetMode =
gmCurrent or maybe earlier in TCustomADODataSet.Locate with the call
to Resync.

Does anybody have a workaround for this ?

cu Christian

 

Re:Locate and Filter on TADOTable


Quote
>The problem is somewhere in TCustomADODataSet.GetRecord with GetMode =
>gmCurrent or maybe earlier in TCustomADODataSet.Locate with the call
>to Resync.

>Does anybody have a workaround for this ?

Use the TbetterADODataset which is a tadoDataset descendant that fixes this
problem and several others
http://web.orbitel.bg/vassil/
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Locate and Filter on TADOTable


Quote

>>Does anybody have a workaround for this ?
>Use the TbetterADODataset which is a tadoDataset descendant that fixes this
>problem and several others

The problem, I described still exists. CorrectlyLocateRecord uses the
Find method and finds a record, that does not match the OnFilter
criteria. And then GetRecord in Resync fails.

I use an OnFilter event, not a Filter string

cu Christian

Other Threads