Sorry, damn Blackberry messing up text.... Damn Suretype...

I meant to say you are not setting application.dsn, but you are setting
application.datasource.

A simple <cfdump var="#application#"> will show you your vars.






"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
To: CF-Talk
Sent: Sat Nov 11 15:00:03 2006
Subject: Re: More DSN Troubles

I can only see you setting application.dsn, you are however setting
application.datasource.








"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Jason T. Slack
To: CF-Talk
Sent: Sat Nov 11 14:55:25 2006
Subject: More DSN Troubles

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:260012
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to