Or just set them as paramaters
<cfparam name="attributes.datasource" default="mydatasource">
<cfparam name="attributes.dbtype" default="odbc">
<cfparam name="attributes.dbname" default="thedbname">
<cfparam name="attributes.dbserver" default="127.0.0.1">
<cfparam name="attributes.dbpassword" default="somedbpassword">
<cfparam name="attributes.dbusername" default="somedbusername">
----- Original Message -----
From: "Deanna L. Schneider" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 13, 2000 2:20 PM
Subject: Re: setting "global" variables
> You can do it by setting those variables as application variables in the
> application.cfm file. Like so:
>
>
> <cflock name="yourappname" type="exclusive" timeout="10">
> <cfif not isdefined("application.datasource")>
> <CFSET application.datasource = "mydatasource">
> <CFSET application.username = "myusername">
> <CFSET application.password = "mypassword">
> </cfif>
> </cflock>
>
> You don't have to check for a defined application datasource, but it keeps
> the snippet from running every time is page is called. Basically, it will
> set the variables the first time, and then you can just read them like so:
>
> <cflock name="yourappname" time="readonly" timeout="10">
> <cfquery name="yourquery" datasource="#application.dsn#"
> username="#application.username#" password="#application.password#>
>
> ---your query here---
>
> </cfquery>
> </cflock>
>
> -d
>
>
>
>
>
> ************************************************************
> Deanna Schneider
> Interactive Media Developer
> UWEX Cooperative Extension Electronic Publishing Group
> 103 Extension Bldg
> 432 N. Lake Street
> Madison, WI 53706
> (608) 265-7923
>
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.