3 Replies - 2536 Views - Last Post: 21 September 2009 - 01:20 AM Rate Topic: -----

#1 mohd_siraj  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 12-August 09

Weird ColdFusion error

Posted 17 August 2009 - 11:39 AM

Hi there ,

I started working on this project ,already developed by someone in '05 , and the client wants some changes to be done.so i went ahead and did some small modifications to the appearance of the form (insertdata.cfm page) like adding some more options to a drop down menu , changing the label names and so on and am very sure this changes would not have effected the application in any way.And the place where the message says the error can be , i didnt even touch that part.Now after 4 days i start getting this weird error saying " Error Occurred While Processing Request
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code."

Null Pointers are another name for undefined values."

And this happens randomly not everytime i access the website or different webpages.Here are the errors.

FIRST ERROR
The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/index.cfm: line 8
5 : SELECT UserName,Password FROM user_data WHERE UserName=
6 : <cfqueryparam value="#FORM.UserName#" maxlength="8">
7 : AND Password=
8 : <cfqueryparam value="#FORM.Password#" maxlength="8">
9 : </cfquery>
10 : <cfif MM_rsUser.RecordCount NEQ 0>


I tried adding " cfsqltype="cf_sql_clob" & varchar but it doesnt work out.

SECOND ERROR

The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/InsertData.cfm: line 13

11 : <cflocation url="#MM_failureURL#" addtoken="no">
12 : </cfif>
13 : <cfquery name="rsDay" datasource="cps">
14 : SELECT days FROM days
15 : </cfquery>


THIRD ERROR

The error occurred in /export/web/virtual/web3_unt_edu/cps/webaccess/sites/Amarillo/InsertData.cfm: line 27

25 : ORDER BY ethnicity ASC
26 : </cfquery>
27 : <cfquery name="rsHospitals" datasource="cps_amarillo">
28 : SELECT *
29 : FROM hospitals

I have attached the screen shots too if anyone wants to take a look.

I am having tough time figuring out where the error can be. I am not much experienced with CF. Please if any one can put some light on the error i would appreciate it greatly .
Thank you
Craj



CODE SNIPPET
<cfif IsDefined("FORM.UserName")>
  <cfset MM_redirectLoginSuccess="menu.cfm">
  <cfset MM_redirectLoginFailed="../../fail.htm">
  <cfset abc=#FORM.UserName# >
  <cfset pqr=#FORM.Password# >
  <cfquery  name="MM_rsUser" datasource="cps_amarillo">
	SELECT UserName,Password FROM user_data WHERE UserName='#abc#'
  <!---<cfqueryparam value="#FORM.UserName#"  maxlength="8"> --->
	AND Password='#pqr#'
  <!---<cfqueryparam value="#FORM.Password#"  maxlength="8"> --->
  </cfquery>
  <cfif MM_rsUser.RecordCount NEQ 0>
	<cftry>
	  <cflock scope="Session" timeout="30" type="Exclusive">
		<cfset Session.MM_Username=FORM.UserName>
		<cfset Session.MM_UserAuthorization="">
	  </cflock>
	  <cfif IsDefined("URL.accessdenied") AND true>
		<cfset MM_redirectLoginSuccess=URL.accessdenied>
	  </cfif>
	  <cflocation url="#MM_redirectLoginSuccess#" addtoken="no">
	  <cfcatch type="Lock">
		<!--- code for handling timeout of cflock --->
	  </cfcatch>
	</cftry>
  </cfif>
  <cflocation url="#MM_redirectLoginFailed#" addtoken="no">
  <cfelse>
  <cfset MM_LoginAction=CGI.SCRIPT_NAME>
  <cfif CGI.QUERY_STRING NEQ "">
	<cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)>
  </cfif>
</cfif>



Admin Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Attached image(s)

  • Attached Image
  • Attached Image
  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Weird ColdFusion error

#2 mehul.saiya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-August 09

Re: Weird ColdFusion error

Posted 20 August 2009 - 09:46 AM

Try adding Username/Password of DSN to the query if required.
Was This Post Helpful? 0
  • +
  • -

#3 cyb1n  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 27
  • Joined: 08-May 09

Re: Weird ColdFusion error

Posted 20 August 2009 - 03:04 PM

From my experience using <cfqueryparam /> the error is being generated from the missing cfsqltype. Double check your database to find out what the field type is. If you've already tried cf_sql_clob then try cf_sql_blob, cf_sql_longvarchar or cf_sql_varchar (only use varchar if you know for sure that the password will be 255 characters or less).
Was This Post Helpful? 0
  • +
  • -

#4 tallgal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-December 07

Re: Weird ColdFusion error

Posted 21 September 2009 - 01:20 AM

Why are you commenting out the <cfqueryparam>?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1