有以下语句:
SQL.Text:='select * from MyTable where count Like '%'''+Edit1.Text+'''%'';或者:
SQL.Text:='select * from MyTable where count Like '%00%'';在编译时老是提示:%字符非法,这是怎么回事?
谁能解决这个简单的问题啊?

解决方案 »

  1.   

    SQL.Text:='select * from MyTable where count Like ''%'+Edit1.Text+'%''  ';看清楚%放在那个地方
      

  2.   

    应该为SQL.Text:= 'select * from MyTable where count Like '+''''+'%'+edit22.Text+'%'''
      

  3.   

    1 是%号放错位置
    应该这样:
      SQL.Text:='select * from MyTable where count Like ''%'+Edit1.Text+'%'''; 2 是单引号出错
     在字符串里一个单引号用两个代替
    应该这样:
      SQL.Text:='select * from MyTable where count Like ''%00%''';
      

  4.   

    delphi里就这点用得不顺手,可以用函数QuotedStr()解决,如下:
    SQL.Text:='select * from MyTable where count Like '+ QuotedStr('%00%');
      

  5.   

    and cuna like '+''''+'%'+LEdit2.Text+'%'+'''';
    上以是可以通过的语句 FOR paradox
      

  6.   

    主要是%放的位置不对'''%'+edit1.text+'%'''
    肯定没有问题的,你再试试。