Skip to main content
Inspiring
November 25, 2008
Answered

application.cfc losing datasource

  • November 25, 2008
  • 1 reply
  • 516 views
I have an application.cfc and .cfm file in my root directory. I also have one of each in a subdirectory called gui. The reason that I need it in the gui directory is that I need users to log in, and I don't want a login for the rest of the site.
So when I created these two files in the gui directory, all of a sudden my apps can't find the datasource or other variables in them. Everything was working just fine before I did this. Can someone take a look at my cfc file and see if there's something wrong? I've attached the code. Thanks.
This topic has been closed for replies.
Correct answer BKBK
Since it involves application variables, you might have to restart the application for the changes to take effect. Also, I expected something like this instead

<cffunction name="onApplicationStart">
<cfparam name="mydatasource" default="taxtest">
<cfset application.datasource="taxtest">
<cfreturn True>
</cffunction>


1 reply

BKBK
Community Expert
BKBKCommunity ExpertCorrect answer
Community Expert
November 26, 2008
Since it involves application variables, you might have to restart the application for the changes to take effect. Also, I expected something like this instead

<cffunction name="onApplicationStart">
<cfparam name="mydatasource" default="taxtest">
<cfset application.datasource="taxtest">
<cfreturn True>
</cffunction>


tgooldAuthor
Inspiring
November 26, 2008
Thanks for your help!