....
 susheinfo_qry.SQL.Add('select * from  sushe where loudongno='+trim(loudong_edt.Text )''+'and'+'susheno='+(fangjian_edt.Text)'');
....错在什么地方呢?

解决方案 »

  1.   

    susheinfo_qry.SQL.Add('select * from  sushe where loudongno='''+trim(loudong_edt.Text )''+'and susheno='''+trim(fangjian_edt.Text)'''');
      

  2.   

    sorry 上面的错了如果你的两个no都是字符型的qry.SQL.Add('select * from  sushe where loudongno='''+trim(loudong_edt.Text )+''' and susheno='''+trim(fangjian_edt.Text)+'''');
      

  3.   

    sorry 上面的错了如果你的两个no都是字符型的qry.SQL.Add('select * from  sushe where loudongno='''+trim(loudong_edt.Text )+''' and susheno='''+trim(fangjian_edt.Text)+'''');
    同意这个!!!
      

  4.   

    这样写不用理字段类型
    susheinfo_qry.SQL.Add('select * from  sushe where loudongno=:A and'+'susheno=:B');
    Parameters.ParamByName('A').Value := loudong_edt.Text;
    Parameters.ParamByName('B').Value := fangjian_edt.Text;