I hate to state the obvious, but we have a function to set up our strings for queries. It adds the single-quotes at beginning and end of string and escapes apostrophes. So that you would create your sql like:
sql := 'field_name = ' + SQLString(someVariable); That way we don't have to think about setting the string up right, but also don't have to use parameters if you don't want to. It suits us, but I don't know if it would suit you. Samuel -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Phil Middlemiss Sent: Tuesday, December 13 2005 9:29 a.m. To: NZ Borland Developers Group - Delphi List Subject: [DUG] Single or Double quotes? Sometimes I can use double quotes when adding a string to an SQL query using Firebird with the Interbase Components. Other times I get an SQL error and have to resort to using single quotes (which is a pain if the string contains an apostrophe). Can someone set me straight on the conditions under which single or double quotes can be used in a query? Cheers, Phil. _______________________________________________ Delphi mailing list [email protected] http://ns3.123.co.nz/mailman/listinfo/delphi
