with adotable1 do
begin
filtered:=false;
filter:='库存量 <= 警告量';
filtered:=true;
end;代码如上,一运行过滤就会出现“参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突”的警告。我把其他代码都去掉了,就留下这几句,还是不行。什么原因啊???

解决方案 »

  1.   

    是与”警告量”字符串比较大小? 常量字符串要用两个单引号括起来。filter:='库存量 <= ''警告量'' ';
      

  2.   

    不支持,所有的行的比较标准必须一样你可用
    adoquery1.clear;
    adoquery1.sql.add(select * from tbl where 库存量<=警告量')
    adoquery1.close;
    adoquery1.open;
    来实现
      

  3.   

    执行ADOQUERY的OPEN过程是很浪费时间的
      

  4.   

    看看这个:
       filter:=format('库存量'+'<= '+'''%d''',[警告量]);
      

  5.   

    adoquery1.clear;
    adoquery1.sql.add('select * from tbl where 库存量<=警告量') //这行
    adoquery1.close;
    adoquery1.open;