sql.Add('INSERT INTO ccc (name) VALUES("'+edit1.Text+'")');

解决方案 »

  1.   

    sql.Add(format('INSERT INTO ccc (name) VALUES(''%s'')',[edit1.Text]));
      

  2.   

    sql.add('select * from m111 where name like '''+edit1.Text+'''');
      

  3.   

    对不起,刚把我的代码考了,没改
    sql.add('insert intto ccc  name values '''+edit1.Text+'''');
      

  4.   

    sql.add('insert intto ccc  name values (''''+edit1.Text+'''')');
      

  5.   

    sql.Add('INSERT INTO ccc (name) VALUES("'+edit1.Text+'")');
      

  6.   

    sql.Add('INSERT INTO ccc (name) VALUES("'+edit1.Text+'")');
      

  7.   

    应改为:sql.Add('INSERT INTO ccc (name) VALUES('+''''+edit1.Text+''''+')');
      

  8.   

    肯定是错的嘛,正确的写法如下:
    使用ADO
    sql.add('insert intto ccc (name) values '''+edit1.Text+'''');
    使用BDE时也是正确的,或者使用bde时可以用
    sql.add('insert intto ccc (name) values "'+edit1.Text+'"');