Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid column name in cfquery with sql server 2005

Status
Not open for further replies.

knightjb1

Programmer
Feb 12, 2008
27
0
0
US
Hello,
I was using an access database to run this web application and i just switched it over to sql server 2005 the databases are identical same column names and everything. But when i switched the datasources on the coldfusion page from the access datasource to the sql datasource the application quit working and gave me an invalid column name error.


Here is where the code errors.

<cfif isdefined("URL.picSelected")>
<cfset pic = "#URL.picSelected#">
<cfelse>
<cfset pic = "false">
</cfif>

<cfquery name="getAttributes" datasource="onlinePlanner">
SELECT * FROM images
WHERE jpeg = "#pic#" OR threeD = "#pic#" OR planview = "#pic#"
</cfquery>

It is telling me that 'false' is not a valid column name. Any idea why?
 
Hey i figured it out it did not like my quotes in the where statement i changed the quotes from " " to ' ' and it works. In case anyone wanted to know =]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top