Browse Source

* Fixed bug #19376: when quoting, quote character should be doubled

git-svn-id: trunk@21491 -
michael 13 years ago
parent
commit
efe5362670
1 changed files with 3 additions and 0 deletions
  1. 3 0
      packages/fcl-db/src/sdf/sdfdata.pp

+ 3 - 0
packages/fcl-db/src/sdf/sdfdata.pp

@@ -1054,7 +1054,10 @@ begin
     // Check for any delimiters occurring in field text
     // Check for any delimiters occurring in field text
     if ((not QuoteMe) and (StrScan(PChar(Str), FDelimiter) <> nil)) then QuoteMe:=true;
     if ((not QuoteMe) and (StrScan(PChar(Str), FDelimiter) <> nil)) then QuoteMe:=true;
     if (QuoteMe) then
     if (QuoteMe) then
+      begin
+      Str:=Stringreplace(Str,QuoteDelimiter,QuoteDelimiter+QuoteDelimiter,[rfReplaceAll]);
       Str := QuoteDelimiter + Str + QuoteDelimiter;
       Str := QuoteDelimiter + Str + QuoteDelimiter;
+      end;
     Result := Result + Str + FDelimiter;
     Result := Result + Str + FDelimiter;
   end;
   end;
   p := Length(Result);
   p := Length(Result);