WEll Jason, you are setting your Dsn twice in your application. first you
are setting it in the application scope and then you are setting it in the
request scope. You only need to set your datasource once and choose between
the application or request scope.

IE:

<cfset application.datasource = "myDsn">

and later

<cfset request.datasource = "myDsn">



Regards,


Doug


----- Original Message ----- 
From: "Jason T. Slack" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Saturday, November 11, 2006 7:55 AM
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:260013
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