select * from table where [pname]='''+edit1.text+'''  不好用

解决方案 »

  1.   

    'select * from table where [pname]='+QuotedStr(edit1.text)
    如果字段是数字型的
    'select * from table where pname='+edit1.text
      

  2.   

    字符
    str:='select * from table where [pname]='''+edit1.text+'''';
    数字
    str:='select * from table where [pname]='+edit1.text;
      

  3.   

    query.sql.add('select * from table where pname=0');这样在access数据查询不行