Board index » off-topic » TClientDataset.locate weird behaviour... possible bug?
Esteban Pacheco
Delphi Developer |
Esteban Pacheco
Delphi Developer |
TClientDataset.locate weird behaviour... possible bug?2005-05-13 05:45:36 AM off-topic3 Hi guys, Today i found out that locate doesn't work if you include boolean columns in the KeyFields and Keyvalues columns. For example ClientDataset1.('IntColumn;BoolColumn',VarArrayOf([1,False]), even if you have that exact pair in the clientdataset resultset, it will not find it. I tried, using 0 instead of False, even using the string 'True', but, it never found it. Well, if you guys know why, it will be great, at the end, i end up doing an ugly looking loop to find the record. Cheers. Att. Esteban Pacheco estebanp.blogspot.com |
Ralf Jansen
Delphi Developer |
2005-05-14 01:49:47 AM
Re:TClientDataset.locate weird behaviour... possible bug?
The way locate is implemented (via filtering) i doubt that locating a
boolean column works (I didn't tried it just look at the source in dbclient.pas). But you shouldn't loop through the clientdataset just filter for the boolean column. Clientdataset.Filter = 'BoolColumn'; Clientdataset.Filtered := True; Use 'not BoolColumn' as filter if you look for a 0. That seems to be the problem as Locate always builds the filterstring with a COLUMN = 'VALUE' pattern. Before reseting the filter you should set a bookmark because changing the Filtered property sets the cursor to the first record. There seems to be no QC report about this. You may want to report it. Ralf Esteban Pacheco schrieb: QuoteHi guys, |
Esteban Pacheco
Delphi Developer |
2005-05-14 04:33:07 AM
Re:TClientDataset.locate weird behaviour... possible bug?
Thanks for reviewing it and the tip.
"Ralf Jansen" < XXXX@XXXXX.COM >wrote in message QuoteThe way locate is implemented (via filtering) i doubt that locating a {smallsort} |