应该这样写
Query1.SQL.Text:='select * from dbo.xxxx where name=''xxxx''';

解决方案 »

  1.   

    Query1.SQL.Text:='select * from dbo.xxxx where name='+'''xxxx'''
      

  2.   

    Query1.SQL.Text:='select * from dbo.xxxx where name=''xxxx'''
      

  3.   

    Query1.SQL.Text:='select * from dbo.xxxx where name='+''''+'xxxx'+''''
      

  4.   

    Delphi 里面的字符串是可以拼好以后再用的啊。呵呵,老兄真有意思!
      

  5.   

    不好意思刚刚写漏了一点!
    Query1.SQL.Text:='select * from dbo.xxxx where name='+'''+xxxx+'''