在Delphi6中如何用adoquery进行模糊查询
我在Delphi6中用Adoquery1调用SQL Server数据库,adoquery1已连接到数据库。 adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.add('select * from 表名');
adoquery1.SQL.add(' where number like '+'"%'+number1.Text+'%"'); adoquery1.Open;
其中number为表中的一字段,number1.text为一文本框,我想查询表中number字段与文本框中内容相匹配的记录,但系统提示“%...%”无效。不知是何原因?请问adoquery如何进行模糊查询?