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
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