想进行模糊查询用了这样一条语句
AdoDs1.commandtext:='select * from school where schoolID like "'+edit1.text+'"';
明明数据库中有记录,但就是显示记录为0。郁闷!!!

解决方案 »

  1.   

    try this:
    AdoDs1.commandtext:='select * from school where schoolID like "%'+edit1.text+'%"';
      

  2.   

    模糊查询条件:select * from table where condition like '%??%'
    得带百分号!(SQL下,ACCESS下是*)
      

  3.   

    select * from table where condition like '+''''+'%'+edit1.text+'%'+'''';
      

  4.   

    哥们。SQL写错了吧
    改成这样看看AdoDs1.commandtext:='select * from school where schoolID like '''+edit1.text+'''';
      

  5.   

    AdoDs1.commandtext:='select * from school where schoolID like ''%'+edit1.text+'%''';