I have an application.cfc that looks like:

<!--- Application.cfm --->
<cfcomponent output="false">

   <cfset THIS.name = "webPOS">

   <cffunction name="onApplicationStart" returnType="boolean"  
output="false">
     <!--- When did the application start? --->
     <cfset APPLICATION.appStarted = now()>
                
        <cfset application.dataSource = "MyDSN">
                
     <cfreturn true>
   </cffunction>

   <cffunction name="onApplicationEnd" returnType="void" output="false">
     <cfargument name="appScope" required="true">

     <!--- Log how many minutes the application stayed alive --->
     <cflog file="#THIS.name#" text="App ended after #dateDiff 
('n',ARGUMENTS.appScope.appStarted,now())# minutes.">

   </cffunction>

   <cffunction name="onRequestStart" returnType="boolean" output="true">
     <!--- Any variables set here can be used by all our pages --->
     <cfset request.dataSource = "MyDSN">
     <cfset request.companyName = "Computer Outlet">

     <cfreturn true>
   </cffunction>

   <cffunction name="onRequestEnd" returnType="void" output="true">

   </cffunction>

</cfcomponent>

And I can calling:

<cfquery name="ckCreds" datasource="#application.dsn#">
SELECT LocationName FROM
      WHERE LocationID = <Cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.user#">
         AND LocationPassword = <cfqueryparam cfsqltype="cf_sql_varchar"
value="#form.password#">
</cfquery>

<cfif ckCreds.recordCount EQ 1>
    <!--- successful login --->
                <cflocation url="main.cfm" />
<cfelse>
    <!--- login failed --->
                <cflocation url="index.cfm" />
</cfif>


but I get an error that states:

  Element DSN is undefined in APPLICATION.

I dont see why, can anyone point it out?

Thanks,

-Jason


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260010
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to