如果只对一个字段进行模糊过虑就没有问题;  adsInventory.Filter := '[存货编码] LIKE ''%' + Edit2.Text + '%''';
但如果加一个字段就有问题  adsInventory.Filter := '[存货编码] LIKE ''%' + Edit2.Text + '%'''+ ' and [存货名称] LIKE ''%' + Edit2.Text + '%''';
请教高手,是怎么回事啊?

解决方案 »

  1.   

    adsInventory.Filter := '[存货编码] LIKE ''%' + Edit1.Text + '%'''+ ' and [存货名称] LIKE ''%' + Edit2.Text + '%'''; 
      

  2.   

    有什么问题,是出错还是逻辑问题(or和and的问题),建议你不用filter,改用sql,那样可以支持复杂的查询
      

  3.   

    adsInventory.Filter := '[存货编码] LIKE '+'%'+Edit2.Text+'%'+' and [存货名称] LIKE '+''''+'%'+Edit2.Text+'%'+'''';
    你的格式有问题,改成这样就好了