you should be able to just output the queryname.recordcount. make sure it is
spelled correctly

Bryan

----- Original Message -----
From: "Steve Reich" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 6:06 PM
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