0:str1:='select * from 基本信息 where 编号 like ' + str2 + '%' +str3 + '%' + str2;//在like后加一个空格。
0:str1:='select * from 基本信息 where 编号='str2+str3+str2;

解决方案 »

  1.   

    最好把str3:=rzedit1.Text;改成str3:=' '+rzedit1.Text+' ';
      

  2.   

    一个引号没必要也定义个变量来存吧
    0:str1:='select * from 基本信息 where 编号 like' + str2 + '%' +str3 + '%' + str2;//输入编号,查找,没任何反映!!!
    ---------
    改成
    0:str1:='select * from 基本信息 where 编号 like ' +#39+ '%' +str3 + '%' +#39;//输入编号,查找,没任何反映!!!
    或者
    0:str1:='select * from 基本信息 where 编号 like ' + Quotdestr('%'+str3+'%');//输入编号,查找,没任何反映!!!
    都行 还有如楼上所说
    注意空格 
    如果你不知道QSL语句对不对 可以设断点看一下 或者showmessage(sql.text);