我需要保存的数据样式是:
   abcd'efghi(中间有一个单引号)
我使用Quotedstr函数保存这种样式的数据,但却保存成了以下样式,
  'abcd''efghi'
请大家帮我想解决的方法

解决方案 »

  1.   

    QuotedStr是前后各加一个单引号,可以这样写:'abcd' + ''' + 'efghi'
      

  2.   

      s:='abcd''efghi';
      quotedstr(s);
      

  3.   

    Delphi语句如下:
    var str:string;
    begin
     edit1.text=abcd'efghi;
     str:=quotedstr(trim(edit1.text));
     with ADOQuery1 do
      begin
       close;
       Sql.Clear;
       sql.Add('insert into sjb(cgsj)values('''+str+''')';
       execsql
      end;
     end;但最后保存到数据表中的数据却是
      'abcd''efghi'
    请问怎样才能保存成
    abcd'efghi
    请大家帮我想解决的方法
      

  4.   

    edit1.text=abcd'efghi;--不是吧,这也能行?edit1.text='abcd'''+'efghi';
      

  5.   

    kaikai_kk 
    正解
      

  6.   

    这样写笨不笨?
    s :='abcd''efghi';
    t :=''''+s+'''';
      

  7.   

    你的程序怕是跑不起来  那个记住在delphi 中''''  ='
      

  8.   

    不要这么钟爱Quotedstr,用参数传递才是王道
      

  9.   

    我认为Quotedstr很好,参数有参数的好处和限制。