Thats because you are passing a reference to the data from your query when
you are calling CFMODULE. You arent actually passing data. When the module
accesses the memory pointed to by the reference, it changes your original
data as well because they are both the same reference. In order to do
something like this, you need to make sure that your are passing data and
not a reference.
You should either run two queries so you have two separate data sets, or
copy the actual data into another query (queryNew()). You *might* be able
to trick structCopy() into doing the job for you but Ive never tried this.
Hope I helped,
Bob Remeika
-----Original Message-----
From: Francisco Montes; Spain on Line [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 1:16 PM
To: Fusebox
Subject: Passing queries as attributes to fuses
Hi,
We have been trying to make a simple experiment: pass a query to another
fuse. What we do is ... show the result set from the called fuse (we modify
it previously) and then do the same with the result set from the main file?s
point of view after the fuse has done its job. Theoretically the result set
in the main file shouldn?t have been changed. That?s what we thought.
However the modification done in the called fuse also DID change the
resultset in the main file.
What?s happening? Obviously both files have been working with the same
result set but that is not what we would expect when we pass it to a fuse as
an extra attribute... or is it?
Francisco Montes
Spain on Line
Code listed as follows:
Main File:
<cfquery name="a" datasource="#BD#">
SELECT ID,Nombre,Estado FROM Lugar
WHERE id<10
</cfquery>
<cfmodule template="mod.cfm" Query="#a#">
<cfloop query="a">
<cfoutput>Nombre -> #Nombre#</cfoutput>
</cfloop>
Fuse being called by the main file:
<cfset Temp = QuerysetCell(Attributes.Query,"Nombre","Changed!",1)>
<br>
<p>Query in called fuse:
<cfloop query="Attributes.Query">
<cfoutput><p>Nombre -> #Nombre#</cfoutput>
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists