table.bh
取出编号前几位为'999'
filter:=copy(bh,1,3)+'=999';
这个为什么 不对?

解决方案 »

  1.   

    var str:string;
    while not table1.eof do 
    begin
    str:=copy(bh,1,3);
    table1.filtered:=false;
    table1.filter:=format('str'+'='+'''%s''',[999]);
    table1.filtered:=true;
    table1.next;
    end;
      

  2.   

    先filtered=false;
    ……
    后filtered=true;
      

  3.   

    建议不要用filtered,用SQL语句解决
      

  4.   

    filtered,用SQL语句解决这一块用TABLE不能用SQL语句呀,
    我也想用ADOQuery来实现。。
      

  5.   

    为什么不能用ADUQUERY控件实现呀?
    select * from table where bh like '999%'
    不就可以了吗?
      

  6.   

    var str:string;
    while not table1.eof do 
    begin
    str:=copy(bh,1,3);
    table1.filtered:=false;
    table1.filter:=format('str'+'='+'''%s''',[999]);
    table1.filtered:=true;
    table1.next;
    end;我试过了,提示出错,我将999换成变量也不行?
      

  7.   

    table.bh
    取出编号前几位为'999'
    filter:=copy(bh,1,3)+'=999';
    我用这个不提示出错,但数据一个也取不出来。