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/cf-talk@houseoffusion.com/
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.

Reply via email to