Subject Re: [IBO] Apostrphe within single quotes
Author Helen Borrie
At 09:48 PM 12/11/2004 -0500, you wrote:

>Suppose a user's input contains a search string like O'Rourke. The resulting
>query would then contain the qualifier, ".where Last_Name containing (or =)
>'O'Rourke'. To avoid a SQL error, this needs to be changed to 'O''Rourke'.
>The obvious solution is simply to advise the user to add the second
>apostrophe manually. To try and avoid that, I have played with this a bit,
>but cannot find my way out of the semantic box created by the ambiguity
>between the apostrophe in the name and the ending single quote. Wondered if
>any of you know of a solution.

Easy!! Let Delphi do the walking ---

ParamByName('CharacterField').AsString :=
QuotedStr(ParamByName('CharacterField').AsString);

HB