Hi Steve, The query is massive so no point copying it all here... but its a simple form var to structure over a multipage process with the final insert occuring that causes the error. I didnt write this code but inherited it with my current job.. For some reason the developer on the insert uses '#StructFind(session.SPrinterRegistration, "ContactCompany")#', to get the value out of the structure instead of simply '#session.SPrinterRegistration.ContactCompany#' ... would rewriting the query thus solve the problem ? Is this considered a simple var still ?
Jason "Steve Onnis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > 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
