Chad,
Nat and the others are correct; you need to surround the City variable
with PreserveSingleQuotes(). It looks fine before running it because
CF's friendly single-quote-escaper hasn't yet acted upon it, but it will,
it will.
-David
On Thu, 19 Oct 2000 08:21:36 -0400 "Chad Elley" <[EMAIL PROTECTED]>
writes:
> I did a cfoutput to check and see what the query looked like before
> running
> it on SQL Server.
>
> ....... UserID=1 and GroupID=56 and City = 'Atlanta' .....
>
> So I know that it has single quotes on it before executing the
> query. I
> have also made sure that all entries are trimmed. I have also used
> LIKE
> instead of =.
>
> Chad
>
> -----Original Message-----
> From: Nat Papovich [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 19, 2000 12:51 AM
> To: CF-Talk
> Subject: RE: Running a Dynamically Created Query
>
>
> The best, fastest thing to try would be to remove the cfquery tag
> and
> replace it with a cfoutput tag. That way, you can see exactly what
> is
> happening, and what all the variables are evaluating to.
>
> But maybe you've already done that...
>
> Are you using PreserveSingleQuotes()?
>
> Nat Papovich
> ICQ 32676414
> "If it was hard to write,"
> says the Real Programmer,
> "it should be hard to understand."
>
>
> -----Original Message-----
> From: Chad Elley [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 18, 2000 9:19 PM
> To: CF-Talk
> Subject: Running a Dynamically Created Query
>
>
> I have set up a series of Cold Fusion templates that build a dynamic
> SQL
> statement. I have run into a "stump in the road" as a result. The
> SQL
> statement consists almost entirely of variables equaling an integer,
> but
> when I have a variable equal to a string, I get errors. For example,
> when I
> attempt to drop a value enclosed in single quotes (i.e. city =
> 'Atlanta'), I
> get errors.
>
> Here is the problem though... We can copy the code into SQL server
> 2K and
> it runs perfectly, but when it executes it through Cold Fusion
> passing it
> into SQL server, it bombs out.
>
> Any suggestions?
>
> Thanks,
> Chad Elley
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]