• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

*SOLVED* ColdFusion/SQL Server Issues with URL Parameters

I have a very basic query going against a database of background check information. The parameters are stored in the URL (status of background check, date range, employee ID, user ID who did the background check). I am adding the feature to export the data to Excel. When I click on "To Excel" on my form, the following happens:

Error Executing Database Query.

[Macromedia][SQLServer JDBC Driver][SQLServer]Invalid column name 'vsec082'. The error occurred in /content/employees/htdocs/emp/operating/she/safety/publicsafety/secure/dvms/backgrd_ckXL.cfm: line 82
Code:
80 :                 <!---User ID pulled from form--->
81 :                 <cfif isdefined("UserID") AND UserID NEQ ''>
[B]82 :                     AND AssignedTo = #UserID#[/B]
83 :                 </cfif>
84 :
What I want to know is...why does SQL Server think the data value I am inputting is a column name. AssignedTo isn't another variable used in the page that creates the Excel spread sheet...so I'm not sure what is going on.
 
Last edited:
Code:
80 :                 <!---User ID pulled from form--->
81 :                 <cfif isdefined("UserID") AND UserID NEQ ''>
[B]82 :                     AND AssignedTo = '#UserID#'[/B]
83 :                 </cfif>
84 :

Wrap it in quotes brotha.
 
Back
Top