what about request scoped variables? Are they available inside components?
---------- Original Message ---------------------------------- From: JediHomer <[EMAIL PROTECTED]> Reply-To: cf-talk@houseoffusion.com Date: Wed, 21 Feb 2007 15:13:28 +0000 > >Yes they are available, however they do need to be in the Application >scope, the initial post was just creating global variables which are >not available to the CFC rather than Application variables. Similarly >as someone has pointed out, the use of the variable was not surrounded >with hashes so the literal word datasource was being used rather than >the value of datasource > > >HTH > > > >On 21/02/07, Dwayne Cole <[EMAIL PROTECTED]> wrote: >> The artcile still does not address what I think is the root of the question >> though. >> >> Are application variables availble inside a component (cfc) initiated within >> that application root? >> >> >> ---------- Original Message ---------------------------------- >> From: "Dan Vega" <[EMAIL PROTECTED]> >> Reply-To: cf-talk@houseoffusion.com >> Date: Wed, 21 Feb 2007 09:31:55 -0500 >> >> > >> >This is not an attempt to promote my work but I just posted an article about >> >this a couple of days ago that I think you would benefit from. >> > >> >http://www.danvega.org/blog/index.cfm/2007/2/19/Avoid-Global-Data >> > >> >Dan Vega >> >http://www.danvega.org/blog/ >> > >> >On 2/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >> >wrote: >> >> >> >> If I define a datasource variable in the application.cfm file in my >> >> webroot >> >> shouldn't that variable be available to a cfc inside my >> >> webroot/components/ >> >> directory? >> >> >> >> in webroot /application.cfm >> >> <CFSET datasource = "database_01"> >> >> >> >> in webroot/components/some.cfc >> >> >> >> <!--- CFC forLa Dolce/Sting contest - ---> >> >> <cffunction name="Expedition" access="public" returntype="query" >> >> output="false"> >> >> <cfquery datasource="datasource" name="Expedition"> >> >> SELECT ID >> >> FROM tbl_Ecotourism >> >> </cfquery> >> >> <cfreturn Expedition> >> >> </cffunction> >> >> >> >> >> >> ERROR IM GETTING >> >> The following information is meant for the website developer for debugging >> >> purposes. >> >> >> >> Error Occurred While Processing Request >> >> Data source datasource could not be found. >> >> >> >> >> > >> > >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:270309 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4