I need help with this application.cfm file...I am having problems in 2 places....Application variables....If I am reading correctly I set up my database connection there....I have change it to reflect...Application.mhs74159 ="Request.App"; Application.DBType = "SQLServer"; but later on the page it states to use the as Datasource = #Request.App.DS#". When i run the pages with the the variables set to Request.App.ds I get the following error on the login_process.cfm page.
DATASOURCE
The value cannot be converted to a string because it is not a simple value. Simple values are booleans, numbers, strings, and date-time values.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (13:4) to (13:54).
Date/Time: 03/04/03 13:14:02
Can someone help me set up the right variables?
<!---
Called From:
Automatically called by all ColdFusion pages within
the same directory or children directories
--->
<!--- Define the application. --->
<!--- applicationtimeout is not set and will use the default of the server. --->
<cfapplication name="Apps"
sessiontimeout="#CreateTimeSpan(0,0,20,0)#"
sessionmanagement="yes" />
<!---
Set a default value for Application.Initialized. If the application scope
has not yet been created, the value will be false. Set the value to a
request variable so the application initialization can be tested without
needing to perform a lock.
--->
<cflock scope="Application" timeout="10" type="exclusive">
<cfparam name="Application.Initialized" default="false" />
<cfset Request.AppInitialized = Application.Initialized />
</cflock>
<!--- If the Application has not been initialized, set the values. --->
<cfif NOT Request.AppInitialized>
<cflock scope="Application" timeout="10" type="exclusive">
<cfscript>
Application.Initialized = true;
// Application variables
// ------------------------
Application.DS = "WebTricks_Apps"; // Change the DS name to the appropriate database DS
Application.DBType = "Access"; // Can be SQLServer, Access or Oracle
// Calendar variables
// ------------------------
// Can anyone add an event? If set to false, only logged in Administrators
// can add events to the calendar.
Application.CalendarAllSubmit = true;
// Should the "Add to Outlook" link display on event details?
Application.CalendarShowOutlookLink = true;
// Set the start and end times to be displayed on the daily calendar
// Minute values must be either 00 or 30 for start or 29 or 59 for end
Application.CalendarStartTime = "08:00"; // Default to "00:00"
Application.CalendarEndTime = "23:59"; // Default to "23:59"
</cfscript>
</cflock>
</cfif>
<!---
Set a default value for Session.Initialized. If the session scope
has not yet been created, the value will be false. Set the value to a
request variable so the application session can be tested without
needing to perform a lock.
--->
<cflock scope="Session" timeout="10" type="exclusive">
<cfparam name="Session.Initialized" default="false" />
<cfset Request.SesInitialized = Session.Initialized />
</cflock>
<!--- If the Session has not been initialized, set the values. --->
<cfif NOT Request.SesInitialized>
<cflock scope="Application" timeout="10" type="exclusive">
<!---
Set the default session variables.
These may change if/when the user logs in.
--->
<cfscript>
Session.Initialized = true;
Session.LoggedInFlag = false;
Session.UserID = "";
Session.AdminFlag = false;
Session.EmailAddress = "";
Session.Name = "";
Session.LastLogin = "";
</cfscript>
</cflock>
</cfif>
<!---
Because Session and Application variables need to be locked
when both read from and written to, the Application and Session
scopes are copied (duplicated) into Request variables that can
be accessed throughout the application without needing to perform a
lock to do a read.
Locks still need to be performed when writing to the Session and
Application Scopes.
To output Session.VarName, just use Request.Ses.VarName
to get the value of Session.VarName without having to use a lock.
Datasource = #Request.App.DS#"
This duplication will be performed each time a page is run
and takes no server overhead.
--->
<cflock scope="Application" timeout="10" type="readonly">
<cfset Request.App = Duplicate(Application) />
</cflock>
<cflock scope="Session" timeout="10" type="readonly">
<cfset Request.Ses = Duplicate(Session) />
</cflock>
<!--- End Application.cfm --->
DATASOURCE
The value cannot be converted to a string because it is not a simple value. Simple values are booleans, numbers, strings, and date-time values.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (13:4) to (13:54).
Date/Time: 03/04/03 13:14:02
Can someone help me set up the right variables?
<!---
Called From:
Automatically called by all ColdFusion pages within
the same directory or children directories
--->
<!--- Define the application. --->
<!--- applicationtimeout is not set and will use the default of the server. --->
<cfapplication name="Apps"
sessiontimeout="#CreateTimeSpan(0,0,20,0)#"
sessionmanagement="yes" />
<!---
Set a default value for Application.Initialized. If the application scope
has not yet been created, the value will be false. Set the value to a
request variable so the application initialization can be tested without
needing to perform a lock.
--->
<cflock scope="Application" timeout="10" type="exclusive">
<cfparam name="Application.Initialized" default="false" />
<cfset Request.AppInitialized = Application.Initialized />
</cflock>
<!--- If the Application has not been initialized, set the values. --->
<cfif NOT Request.AppInitialized>
<cflock scope="Application" timeout="10" type="exclusive">
<cfscript>
Application.Initialized = true;
// Application variables
// ------------------------
Application.DS = "WebTricks_Apps"; // Change the DS name to the appropriate database DS
Application.DBType = "Access"; // Can be SQLServer, Access or Oracle
// Calendar variables
// ------------------------
// Can anyone add an event? If set to false, only logged in Administrators
// can add events to the calendar.
Application.CalendarAllSubmit = true;
// Should the "Add to Outlook" link display on event details?
Application.CalendarShowOutlookLink = true;
// Set the start and end times to be displayed on the daily calendar
// Minute values must be either 00 or 30 for start or 29 or 59 for end
Application.CalendarStartTime = "08:00"; // Default to "00:00"
Application.CalendarEndTime = "23:59"; // Default to "23:59"
</cfscript>
</cflock>
</cfif>
<!---
Set a default value for Session.Initialized. If the session scope
has not yet been created, the value will be false. Set the value to a
request variable so the application session can be tested without
needing to perform a lock.
--->
<cflock scope="Session" timeout="10" type="exclusive">
<cfparam name="Session.Initialized" default="false" />
<cfset Request.SesInitialized = Session.Initialized />
</cflock>
<!--- If the Session has not been initialized, set the values. --->
<cfif NOT Request.SesInitialized>
<cflock scope="Application" timeout="10" type="exclusive">
<!---
Set the default session variables.
These may change if/when the user logs in.
--->
<cfscript>
Session.Initialized = true;
Session.LoggedInFlag = false;
Session.UserID = "";
Session.AdminFlag = false;
Session.EmailAddress = "";
Session.Name = "";
Session.LastLogin = "";
</cfscript>
</cflock>
</cfif>
<!---
Because Session and Application variables need to be locked
when both read from and written to, the Application and Session
scopes are copied (duplicated) into Request variables that can
be accessed throughout the application without needing to perform a
lock to do a read.
Locks still need to be performed when writing to the Session and
Application Scopes.
To output Session.VarName, just use Request.Ses.VarName
to get the value of Session.VarName without having to use a lock.
Datasource = #Request.App.DS#"
This duplication will be performed each time a page is run
and takes no server overhead.
--->
<cflock scope="Application" timeout="10" type="readonly">
<cfset Request.App = Duplicate(Application) />
</cflock>
<cflock scope="Session" timeout="10" type="readonly">
<cfset Request.Ses = Duplicate(Session) />
</cflock>
<!--- End Application.cfm --->