Would this be of any help? I use it all the time for this.
<cffunction name="queryRowToStruct" access="private" returntype="struct"
hint="I return a structure from a queryRow passed into
me."
output="false">
<cfargument name="query" required="Yes" type="query" />
<cfargument name="row" type="numeric" default="1" />
<cfset var ii=1 />
<cfset var cols = listToArray(query.columnList) />
<cfset var structReturn = StructNew() />
<cfscript>
for(ii = 1; ii lte arraylen(cols); ii = ii + 1){
structReturn[cols[ii]] =
query[cols[ii]][arguments.row];
}
</cfscript>
<cfreturn structReturn />
</cffunction>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Ken Ingle
Sent: Thursday, January 13, 2005 10:46 PM
To: [email protected]
Subject: Re: [CFCDev] Query Current Row Bug....
While looping over it, using cfloop, and yes on the record count :-),
I'll put together an example tonight and send it. But I am thinking I
need to find a way to pass the specific row I want to the cfc instead
of the whole query. I am having little luck finding how to do that on
a whole row.
On Thu, 13 Jan 2005 22:31:19 +0100, Trond H. Bendiktsen
<[EMAIL PROTECTED]> wrote:
> show us the code! :-)
>
> i'm a little confused when you say that the "CFC then loops over the query
> and passed the query to a function". does it pass the query to a function
> after having looped over it, or while looping over it? do you loop through
> the query using cfloop, or cfoutput?
>
> also, you say that - in the "final" cfc - "If I dump query.currentrow, it
> shows the correct row number in the database". i assume that by this you
> mean that dumping the query.recordCount variable shows the correct number
of
> rows in the recordset...?
>
> anyway: think we (at least i) need to see the code
>
> mvh >> thb/cf
> ---------------------------------------
> <ponderthis>
> Why is it drug addicts and computer
> afficionados are both called users?
> </ponderthis>
> ---------------------------------------
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Ken Ingle
> > Sent: Thursday, January 13, 2005 9:51 PM
> > To: [email protected]
> > Subject: [CFCDev] Query Current Row Bug....
> >
> > I am having a problem.
> >
> > I have a query that is being returned to a CFC, that CFC then loops
> > over the query and passes the query to a function. The function then
> > calls another CFC (passing the query with it) that builds an object.
> >
> > When the query gets passed to that last CFC it is losing its cursor.
> > If I dump query.currentrow, it shows the correct row number in the
> > database, but it will not use the current rows data to build the
> > object, only the first row.
> >
> > Has anybody run into this problem before?
> >
> > --
> > Ken Ingle
> > KICWEB Design
> > [EMAIL PROTECTED]
> > http://www.kicweb.com
> > http://www.kicweb.com/blog
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email
> > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> > in the message of the email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported
> > by Mindtool, Corporation (www.mindtool.com).
> >
> > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> >
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
>
--
Ken Ingle
KICWEB Design
[EMAIL PROTECTED]
http://www.kicweb.com
http://www.kicweb.com/blog
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]