[thelist] ColdFusion/SQL - treat as Number

jeff jeff at members.evolt.org
Wed May 9 14:47:03 CDT 2001


jon,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: jon steele
:
: I am using ColdFusion and Access and if a
: field has a "'" (apostrophe) in it, CF
: throws an error on the SQL.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

that is by no means the default behavior.  are you using a hardcoded string
in your query or a variable?  if a variable, how are you accessing it's
value within the query?

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: I tried replacing the outer quotes with double
: quotes, but it still gave an error. Is there
: another way around this?
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sure, just double up your single quotes in your string:

Replace(string, "'", "''", "ALL")

the double-quotes around the value doesn't work because the database expects
all string values to be wrapped in single-quotes.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: If you need me to explain a little more,
: please ask.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

please do.

thanks,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list