adotable:dm.table.filtered:=false;
dm.table.Filter:='cc=''cccc'' and aa=''dddd'' or bb=''bbbb' ';
dm.table.Filtered:=true;成功!dm.table.filtered:=false;
dm.table.Filter:='cc=''cccc'' and (aa=''dddd'' or bb=''bbbb') ';
或 dm.table.filter:='cc=''cccc'' or bb=''bbbb'' and aa=''aaaa'' '
dm.table.Filtered:=true;失败! 为什么??
另外
dm.table.FilterOptions:=[foCaseInsensitive];
失败,如何实现模糊查询?
dm.table.Filter:='cc=''cccc'' and aa=''dddd'' or bb=''bbbb' ';
dm.table.Filtered:=true;成功!dm.table.filtered:=false;
dm.table.Filter:='cc=''cccc'' and (aa=''dddd'' or bb=''bbbb') ';
或 dm.table.filter:='cc=''cccc'' or bb=''bbbb'' and aa=''aaaa'' '
dm.table.Filtered:=true;失败! 为什么??
另外
dm.table.FilterOptions:=[foCaseInsensitive];
失败,如何实现模糊查询?
这几天看到好多因为引号导致的问题,唉~
模糊查询在Filter里也可以使用,可以用like '*关键字'的形式
运行提示'变量不在接受范围之内,或与其他数据冲突'!苦恼啊!
1.filter 不能用in操作,通配用a*;
2.filter 不支持a and (b or c),要改写成(a and b) or (a and c)
3.filter 不能用is NULL来过滤,而可用= NULL