Subject Re: Upgrade problem
Author Adam
Just a follow-up to Martijn's suggestion,

I recommend using parameters because then Delphi takes care of a lot
of the nasties for you.

Query.ParamByName('myvalue').AsString := tedit1.text;

But if you can't avoid dynamically building it, then there is a
function in Delphi StringReplace

MyValue := StringReplace(MyValue, CHR(39), CHR(39)+CHR(39),
[rfReplaceAll]);

Hope that helps

Adam