Try <cfdump var="#nextEvent#" />
And you also need to add this at the top of your function for getEvent.
<cfset var getEvent />
Or you could do this
<cfset var local = {} />
and reference it like this
<cfquery name="local.getEvent" datasource="liveoldschool">
Otherwise you will experience a lot of race conditions in your code.
On Fri, Jan 22, 2010 at 10:02 AM, James Thompson <[email protected]> wrote:
>
> All,
> I have a CF8 Component that has a returntype of query. The function simple
> queries a database. My question is how do I, on my .cfm page access the
> query from my .cfc page? I am getting an error now about not being able to
> convert complex objects to simple objects.
>
> **********COMPONENT CODE*********************
>
> <cffunction name="getEvent" access="public" returntype="query">
> <cfquery name="getEvent" datasource="liveoldschool">
> SELECT * FROM events
> WHERE date >= curDate()
> LIMIT 1
> </cfquery>
> <cfset nextEvent = getEvent />
> <cfreturn nextEvent>
> </cffunction>
>
>
> ********.CFM CODE************************************
> <cfinvoke component="components.queries" method="getEvent"
> returnvariable="nextEvent" />
> <cfoutput>#nextEvent#</cfoutput>
>
> Any help would be appreciated!
>
> james
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4939
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15