|Subject||RE: using a parameter containing a single quote|
Sorry, I had tried responding by email, but that was bounced. I recompiled this morning and now it works. No changes to the code at all. Don't you just love computers?
Many thanks for all you ideas and the quick response.
Anyway, for completeness here is the spec of components etc
Delphi XE2, FireDAC TADQuery, Firebird 2.5.2 with fbClient.dll - all fully updated
to remove any variability with passing the variable to routine, the email address has been hard coded. So code is:
record 1 : email = pam.o'neill@...
record 2 : email = pam.oneill@...
sql = 'SELECT * FROM PERSON WHERE EMAIL = :EMAIL';
sql1 = 'SELECT * FROM PERSON WHERE EMAIL = ''%s''';
emailvar := 'pam.o''neill@...';
emailvar1 := 'pam.oneill@...';
AQuery := TADQuery.Create(nil);
AQuery.SQL.Text := sql;
AQuery.ParamByName('EMAIL').AsString := emailvar;
result := not AQuery.IsEmpty;
---In firstname.lastname@example.org, <reinierolislagers@...> wrote:On 16/10/2013 00:48, russell@... wrote:
> Yes caught me out to, a single quote is allowed in email addresses toAFAIU, you still haven't indicated what data access components you use
> the left of the @ apparently.
with Delphi. As I think Mark said, the db access component should deal
with the quoting of the parameter for you.