views:

278

answers:

3

I have a query that is being used in a coldfusion file (MX)( on the Production since 10 yrs ). I have used this application/files since 4 months,successfully. But now ,Suddenly I am getting the error Element RECORDCOUNT is undefined in "yyReslt"

Will this occur if the Database connection is slow/improper?

+2  A: 

Are there any conditionals around the cfquery? Are you sure it is being ran? You should turn on debugging for your IP address to make sure the query is running.

Also, you would get a different error if the connection timed out.

Jason
Hi Jason .Thanx for the reply. how do i debug from my IP address....does that mean testing on my local sytem?
vas
Here are the details from Adobe's Livedocs http://livedocs.adobe.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/Debug4.htm
Jason
+1  A: 

Sounds like your query might have some cfif statements in/around it, and nothing is being done. In addition to what Jason mentioned, you can also use cfdump to view the query object on your screen without turning on the debug data.

<cfdump var="#yyReslt#">
Jason
A: 

This also could be a concurrency issue combined with unscoped variables if happening within the context of a component that exists in the application scope, but the query variable was not scoped within the component.

<cfcomponent>
 <cffunction name="foo">
  <cfquery name="yyReslt" datasource="DB">
     SELECT ...
 </cffunction>
  <cfif yyReslt.RecordCount GT 1>
     .... DO SOME WORK ....
  </cfif>
</cfcomponent>

simply scoping yyReslt at the before the query would fix this.

<cfset var yyReslt = "" />

All variables need to be scoped, varscoper is helpful in checking components for scoping omissions.

http://varscoper.riaforge.org/

np0x