Board index » delphi » TADOTable.Locate bug

TADOTable.Locate bug

Hi all

Have any of you found a workaround (or even the bug itself!) for the locate
method in TADOTable?  If you reduce the number of fields in the locate
criteria in the code, the larger searches no longer work.  Try this simple
example. TADOConnection (Access2000), TADOTable, a source and a db grid to
watch it, then 4 buttons which do something like

Button 1 -    Tbl_Test.Locate('Field1;Field2',VarArrayOf([100,101]),[]);
Button 2 -    Tbl_Test.Locate('Field1;Field2',VarArrayOf([200,201]),[]);
Button 3 -    Tbl_Test.Locate('Field1',100,[]);
Button 4 -    Tbl_Test.Locate('Field1',200,[]);

If you try the first two first, all works ok and the records are located.
As soon as you perform a locate on just one field, subsequent locates on 2
fields fail.  Eg, if you initially only click buttons 1 and 2, all will work
OK.  as soon as you click button 3 or 4, then buttons 1 and 2 stop working
(although 3 and 4 continue to work OK)!

Is there any way to somehow reset the locate method?

Cheers

 

Re:TADOTable.Locate bug


U?ytkownik Richard Collier <r...@armature.com> w wiadomo?ci do grup
dyskusyjnych napisa3:3cc698f6_1@dnews...

Quote
> Hi all

> Have any of you found a workaround (or even the bug itself!) for the
locate
> method in TADOTable?  If you reduce the number of fields in the locate
> criteria in the code, the larger searches no longer work.  Try this simple
> example. TADOConnection (Access2000), TADOTable, a source and a db grid to
> watch it, then 4 buttons which do something like

> Button 1 -    Tbl_Test.Locate('Field1;Field2',VarArrayOf([100,101]),[]);
> Button 2 -    Tbl_Test.Locate('Field1;Field2',VarArrayOf([200,201]),[]);
> Button 3 -    Tbl_Test.Locate('Field1',100,[]);
> Button 4 -    Tbl_Test.Locate('Field1',200,[]);

> If you try the first two first, all works ok and the records are located.
> As soon as you perform a locate on just one field, subsequent locates on 2
> fields fail.  Eg, if you initially only click buttons 1 and 2, all will
work
> OK.  as soon as you click button 3 or 4, then buttons 1 and 2 stop working
> (although 3 and 4 continue to work OK)!

> Is there any way to somehow reset the locate method?

> Cheers

Use component TBetterAdoDataSet.

M.S.

Re:TADOTable.Locate bug


Quote
> Use component TBetterAdoDataSet.

> M.S.

Hmm, tried that and it seems to do the same thing as TADOTable.

Any more suggestions?

Rich

Re:TADOTable.Locate bug


U?ytkownik "Richard Collier" <r...@armature.com> napisa3 w wiadomo?ci
news:3cc6c771$1_2@dnews...

Quote
> > Use component TBetterAdoDataSet.

> > M.S.

> Hmm, tried that and it seems to do the same thing as TADOTable.

> Any more suggestions?

> Rich

Hi.

TBetterAdoDataSet component:
http://web.orbitel.bg/vassil/

BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

M.S.

Re:TADOTable.Locate bug


Huh?

I downloaded TBetterADODataSet and tried using that instead of TADOTable and
I still get the same problem.

    BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

works fine until you do

    BetterADODataSet1.Locate('Field1',100,[]);

After that,

    BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

stops working.  I can send you an example if you like?

Delphi 6 (update 2)
Database is Access 2000
ADO Ver 1.5
BetterADS Ver 3.04
MS Jet Ver 04.00.0000
OLEDBVer 02.10
Provider MSJETOLEDB40.DLL
Provider Ver 04.00.2927

Quote
"MS" <Macie...@acn.waw.pl> wrote in message news:3cc7083b_1@dnews...

> U?ytkownik "Richard Collier" <r...@armature.com> napisa3 w wiadomo?ci
> news:3cc6c771$1_2@dnews...
> > > Use component TBetterAdoDataSet.

> > > M.S.

> > Hmm, tried that and it seems to do the same thing as TADOTable.

> > Any more suggestions?

> > Rich

> Hi.

> TBetterAdoDataSet component:
> http://web.orbitel.bg/vassil/

> BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

> M.S.

Re:TADOTable.Locate bug


U?ytkownik Richard Collier <r...@armature.com> w wiadomo?ci do grup
dyskusyjnych napisa3:3cc7bf4a_1@dnews...

Quote
> Huh?

> I downloaded TBetterADODataSet and tried using that instead of TADOTable
and
> I still get the same problem.

>     BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

> works fine until you do

>     BetterADODataSet1.Locate('Field1',100,[]);

> After that,

>     BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

> stops working.  I can send you an example if you like?

> Delphi 6 (update 2)
> Database is Access 2000
> ADO Ver 1.5
> BetterADS Ver 3.04
> MS Jet Ver 04.00.0000
> OLEDBVer 02.10
> Provider MSJETOLEDB40.DLL
> Provider Ver 04.00.2927

> "MS" <Macie...@acn.waw.pl> wrote in message news:3cc7083b_1@dnews...

> > U?ytkownik "Richard Collier" <r...@armature.com> napisa3 w wiadomo?ci
> > news:3cc6c771$1_2@dnews...
> > > > Use component TBetterAdoDataSet.

> > > > M.S.

> > > Hmm, tried that and it seems to do the same thing as TADOTable.

> > > Any more suggestions?

> > > Rich

> > Hi.

> > TBetterAdoDataSet component:
> > http://web.orbitel.bg/vassil/

> > BetterADODataSet1.Locate('Field1;Field2',VarArrayOf([100,101]),[]);

> > M.S.

Hi
Try ADO- version 2.52
ADO Ver 1.5 is very old.

Re:TADOTable.Locate bug


OOps, that was a typo.  I have ADO 2.5.  I am downloading 2.52 now though.

Thanks.

Quote
> Hi
> Try ADO- version 2.52
> ADO Ver 1.5 is very old.

Re:TADOTable.Locate bug


Quote
> Hi
> Try ADO- version 2.52
> ADO Ver 1.5 is very old.

Downloaded 2.52 and installed and it all seems to work OK now.  Thanks for
your help

Rich.

Other Threads