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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cold Fusion/Embedded SQL error

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
I am writing a series of pages that:<br><br>1.&nbsp;&nbsp;Allow data entry;<br>2.&nbsp;&nbsp;Display the entered data;<br>3.&nbsp;&nbsp;Offer the user the ability to correct any typos from the<br>&nbsp;&nbsp;&nbsp;&nbsp;second form.<br><br>The problem arises with the embedded SQL statement on my 3rd/4th forms.&nbsp;&nbsp;&nbsp;When I enter a specific SSN, the query works and the correct information is displayed.&nbsp;&nbsp;When I use the '#variable#', I get the below error:<br><br>Error Diagnostic Information<br>Error resolving parameter SSN<br><br><br>ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either: <br><br>You have misspelled the parameter name, or <br>You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.<br><br>The error occurred while evaluating the expression: <br>#SSN#<br><br>The error occurred while processing an element with a general identifier of (#SSN#), occupying document position (14:14) to (14:18).<br><br>Below is my query:<br><br><br>&nbsp;&lt;cfquery name=&quot;MyQuery&quot; datasource=&quot;EmployeeDatabase&quot; dbtype=&quot;odbc&quot;&gt;<br>Select *<br>From Employee<br>WHERE SSN = '#SSN#'<br>&lt;/cfquery&gt;<br><br>&lt;cfform action=&quot;RecruiterChanges.cfm&quot; method=&quot;post&quot; enablecab=&quot;yes&quot;&gt;<br><br><br>I have used '#form.variable#'; I've used #variable#; I've used #form.variable#.&nbsp;&nbsp;NONE OF THESE WORK!!!&nbsp;&nbsp;What am I missing?!?!?!??!<br><br>(Any assistance will be GREATLY appreciated.&nbsp;&nbsp;I suspect this is something very simple...)<br><br>Thanks in advance!<br>
 
Achai,<br><br>Thanks for the suggestion.&nbsp;&nbsp;Unfortunately, I just tried it and received the same error message:Error Diagnostic Information<br>Error resolving parameter SSN<br><br><br>ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either: <br><br>You have misspelled the parameter name, or <br>You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.<br><br>The error occurred while evaluating the expression: <br><br><br>#SSN#<br><br>&nbsp;<br>Have you any idea why the query and form works when I hard code my variable but doesn't when I reference it?<br><br><br><br>
 
The #SSN# parameter is not being passed to the page you have your query on... check the form before it for<br>&lt;input type=&quot;text&quot; name=&quot;SSN&quot;&gt;<br><br>If you have a multi-page form, you still have to pass the parameter..<br>&lt;cfoutput&gt;<br>&lt;input type=&quot;hidden&quot; name=&quot;SSN&quot; value=&quot;#SSN#&quot;&gt;<br>&lt;/cfoutput&gt;<br><br>let me know if this works, if not, I'll need more details...
 
Darkman,<br><br>Thanks for the tip - I checked my forms and I am passing the parameter.&nbsp;&nbsp;<br>Here is my code from my first form - data entry: <br><br>&nbsp;&nbsp;&nbsp;&lt;th&gt;SSN:&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;cfinput type=&quot;Text&quot; name=&quot;SSN&quot; message=&quot;SSN is a required field!&quot; validate=&quot;social_security_number&quot; required=&quot;Yes&quot; size=&quot;9&quot; maxlength=&quot;11&quot;&gt;(ex: 123-45-6789)&lt;/td&gt;<br><br>The information correctly passes to form 2.&nbsp;&nbsp;&nbsp;I've declared the SSN parameter on form 2.&nbsp;&nbsp;When I select the update data link (which is supposed to take this same information from form 2 and pass it to form 3 and allow updates) I get a blank page instead of my data update form.<br><br>My SSN parameter is declared before my CFForm action on form 2.&nbsp;&nbsp;On form 3, the parameter is after my last header tag and before my first form tag.&nbsp;&nbsp;The closing CFOutput tag follows my data variables.&nbsp;&nbsp;<br><br>When I hardcode the SSN as 'xxx-xx-xxxx', I get a result.&nbsp;&nbsp;As a variable, I now get a blank form instead of my data update form (form 4).<br><br>Clear as mud?&nbsp;&nbsp;What am I missing?!?!?<br><br>
 
I need to change my name from Programmher to &quot;The Happy Hacker&quot;.&nbsp;&nbsp;Hacking is what I've been reduced to doing.&nbsp;&nbsp;I have tried SEVERAL variations of my query in hopes of getting it to work.&nbsp;&nbsp;I have used:<br><br>&quot;xxx&quot; = all records are returned<br>'xxx' = zero records are returned<br>#xxx# = error message<br>&quot;#xxx#&quot; = error message<br>'#xxx#' = error message<br>&quot;#form.xxx#&quot; = error message<br>'#form.xxx#' = error message<br><br>Calamity and woe...any suggestions?
 
I need to change my name from Programmher to &quot;The Happy Hacker&quot;.&nbsp;&nbsp;Hacking is what I've been reduced to doing.&nbsp;&nbsp;I have tried SEVERAL variations of my query in hopes of getting it to work.&nbsp;&nbsp;I have used:<br><br>&quot;xxx&quot; = all records are returned<br>'xxx' = zero records are returned<br>#xxx# = error message<br>&quot;#xxx#&quot; = error message<br>'#xxx#' = error message<br>&quot;#form.xxx#&quot; = error message<br>'#form.xxx#' = error message<br><br>Calamity and woe...any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top