add(
'select name,user from dbo.canpin where(user not in('''测试''')').

解决方案 »

  1.   

    add('select name,user from dbo.canpin where(user not in(''测试'')').
      

  2.   

    测试使用单引号者编译器报错,使用双引号者运行时报sql语句错误,CoolSlob(无形的压力压得我好累)兄的方法也不行.
      

  3.   

    select name,user from dbo.canpin where user not in('测试')
    我试过的,通过。
      

  4.   

    在delphi6中不容许出现''''的情况.如果使用add('select name,user from dbo.canpin where user not in('测试')')语句delphi提示Illegal character in input:'测'[$B2E2]
      

  5.   

    add('select name,user from dbo.canpin where(user not in(''测试'')').
    這樣沒有問題,若不行再加兩個
      

  6.   

    应该这样
    add('select name,user from dbo.canpin where user not in(''测试'')');
      

  7.   

    测试是user表中的内容,如果使用双引号的话sql连接后将把测试认为是表的标题,而不是表的内容.
      

  8.   

    应该是什么数据库如果是sql server add('select name,user from dbo.canpin where user not in ('+''''+'测试'+''''+')');
      

  9.   

    在delphi中使用两个单引号代表一个单引号。
      

  10.   

    你用一下Quotedstr函数,他是把字符串中的单引号和双引号做了处理,然后在字符串首尾加引号的一个处理函数,可以看看帮助