That was it! Thanks Jann!

Steve

"Jann VanOver" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> ???  You say "the name of the query is an integer", but in the example you
> gave,the name is "myQuery".  If it is really an integer, this is NOT good!
> "Names" cannot begin with a number.  Try adding a character on the front
of
> it, like:
>
> <cfquery name="q_#queryName#" ...
>   ...
> <cfset queryCount    = evaluate("q_" & queryName & ".recordcount")>
>
>
> -----Original Message-----
> From: Steve Reich [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 4:07 PM
> To: CF-Talk
> Subject: Dynamic Queries (RecordCount)
>
>
> How do I set a variable equal to the recordcount of this query? Here's
what
> I've been trying....
>
> <~~~~~~~~~~~~~CODE~~~~~~~~~~~~~~~~>
> <cfset queryName = "MyQuery">
>
> <cfquery name="#queryName#" datasource="#application.dns#" dbtype="ODBC"
> username="#application.dns_username#"
password="#application.dns_password#"
> cachedwithin="#CreateTimeSpan(0,0,10,0)#">
> SELECT *
> FROM data
> WHERE dataid = #dataid#
> </cfquery>
>
> <cfset queryCount    = evaluate(queryName & ".recordcount")>
>
> <cfoutput>#queryCount#</cfoutput>
> <cfabort>
>
> <~~~~~~~~~~~~~CODE~~~~~~~~~~~~~~~~>
>
> This code returns the following error:
>
> <~~~~~~~~~~~~~ERROR~~~~~~~~~~~~~~~~>
> Error Diagnostic Information
>
> An error occurred while evaluating the expression:
>
>
>  queryCount=evaluate(queryName & ".RecordCount")
>
>
>
> Error near line 109, column 7.
> An error has occurred while processing the expression:
>
>    21.RecordCount
>
>
> Invalid parser construct found on line 1 at position 4. ColdFusion was
> looking at the following text:
>
> RecordCount
> Invalid expression format. The usual cause is an error in the expression
> structure.
> <~~~~~~~~~~~~~ERROR~~~~~~~~~~~~~~~~>
>
> Seems like I've done this a million times, but I'm not hitting on all
> cylinders today. The name of the query is an integer if that makes any
> difference. Can somebody point out the obvious for me?
>
> Thanks,
> Steve
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to