Never mind... figured it out in the 8.5 hour delay while waiting for my
message to post (what's up with the list today??).
Anyway, you can escape single quotes in a text column insertion in SQL
Server 7 with two single quotes in a row.
-Ron
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 12, 2000 6:13 PM
> To: [EMAIL PROTECTED]
> Subject: How to escape single quotes for SQL manually?
>
>
> I've got a cfquery built with cfloop like so:
>
> <cfquery name="AddClicker" datasource="#DS#" username="#DSUsername#"
> password="#DSPassword#">
> INSERT INTO Clickers (#myFieldList#)
> <cfset myLoopCount=0>
> VALUES
> (
> <cfloop list="#myFieldList#" index="i">
> '#Trim(Evaluate("form.#i#"))#'
> <cfset myLoopCount=incrementValue(myLoopCount)>
> <cfif myLoopCount LT ListLen(myFieldList)>,</cfif>
> </cfloop>
> )
> </CFQUERY>
>
> Problem is, using the Evaluate function to get my values bypasses CF's
> built-in single quote escaping mechanism, and this query will
> throw an ODBC
> error when trying to insert a field with a single quote.
>
> What is the syntax to escape a single quote for SQL Server 7, so I can
> manually replace those chars prior to insertion?
>
> thx,
> Ron
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.