Jason

Coldfusion will escape the singlequotes on its own, but only is the variable
being used is a somple variable.

A simple variable is what you get when you do something like <cfset myVar =
"St Ursula's College">.

But is you had something like

<cfset myVar = ArrayNew(1)>
<cfset myVar[1] = "St Ursula's College">

I believe that it wont escape the singlequotes

Can we have alook at your full query and where your getting the variables
from?

Regards
Steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jason Bayly
Sent: Thursday, January 22, 2004 9:53 AM
To: CFAussie Mailing List
Subject: [cfaussie] CFMX not escaping single quotes


Hi all

I'm getting repeated syntax errors on an insert statement that has to do
with a single quote appearing in a string. In the past ive never had to
worry about single quotes in a string cause i thought CF automatically
escaped them in a query. Am i incorrect here ?

heres part of the debug msg... any one got a good method to ensure this
doesnt happen ??

ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 161: Incorrect syntax
near 's'.

VALUES ( '38 Taylor Street', '', 'Toowoomba', 'St Ursula's College',



cheers
jason



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to