[AccessD] Building SQL statement

Stuart McLachlan stuart at lexacorp.com.pg
Wed Aug 24 22:30:07 CDT 2005


On 24 Aug 2005 at 23:23, John W. Colby wrote:

> 
> The problem is that description can contain the ' character and thus I end
> up with an invalid SQL statement since the ' embedded in description "looks
> like" the ' that is supposed to enclose the text.
> 
> I can't for the life of me remember how I am supposed to handle this.
> 

Description = Replace(Description,"'","''")

That's a single quote between double quotes as the second parameter and two 
single quotes between double quotes as the third parameter.

Double up the single quote "escapes" it in the input string

-- 
Stuart





More information about the AccessD mailing list