clientdataset的 filter 过滤功能在某些时候是非常方便的,windows下没任何问题,
可安卓下面对中文失效,这就让人头大了
我本想实现like功能
在win下测试没问题,可安卓下数字字母没问题,中文就不行
后来只好放弃 like语法
方法1::
用下面的方法
procedure TMainForm.ClientDataSet1FilterRecord(DataSet: TDataSet;
var Accept: Boolean);
begin
if pos('中文',DataSet.fieldbyname('name').asstring) > 0 then
Accept := true
else Accept := false;
end;
button.click 执行filter
ClientDataSet1.Filtered := false;
ClientDataSet1.Filtered := true;
方法2:
自己写个方法,用循环去pos检索
first;
while not eof do
begin
if pos('中国',fieldbyname('aa').asstring) > 0 then
stringlist.add(fieldbyname('aa').asstring)
next;
end;
//stringlist就是模糊检索到的数据