Subject | Re: [firebird-support] locate O'Connor |
---|---|
Author | Paul Vinkenoog |
Post date | 2005-09-28T00:12:12Z |
Hi Sam,
this:
sql.strings[2] := 'where upper(Last_Name)='
+ AnsiQuotedStr( uppercase(dbeditLastName.Text), '''' );
AnsiQuotedStr puts quote characters (specified in second arg) around
the string given in the first arg, and doubles any quote chars that
are in the string.
With single-byte character sets, you can also use
QuotedStr( s )
which is equivalent to
AnsiQuotedStr( s, '''' )
(Please note that '''' passes just *one* single-quote character to
the function.)
Greetings,
Paul Vinkenoog
> sql.strings[2]:='whereApostrophes have to be escaped with another apostrophe. In Delphi, do
> upper(Last_Name)='+#39+uppercase(dbeditLastName.Text)+#39+' ';
>
> errors when dbeditLastName.Text contains an apostrophe (single
> quote) in the name, as in O'Connor. The query reports that "Connor"
> is an unknown token.
this:
sql.strings[2] := 'where upper(Last_Name)='
+ AnsiQuotedStr( uppercase(dbeditLastName.Text), '''' );
AnsiQuotedStr puts quote characters (specified in second arg) around
the string given in the first arg, and doubles any quote chars that
are in the string.
With single-byte character sets, you can also use
QuotedStr( s )
which is equivalent to
AnsiQuotedStr( s, '''' )
(Please note that '''' passes just *one* single-quote character to
the function.)
Greetings,
Paul Vinkenoog