Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.cfm DSN 1

Status
Not open for further replies.

rmz8

Programmer
Aug 24, 2000
210
US
How do you define a DSN in Application.cfm that can then be referenced throughout the queries in an application? Also, how do you reference to the DSN declared in Application.cfm in your queries?

Ryan ;-]
 
On the Application.cfm page set a variable to represent your DSN name.

<CFSET dsn = &quot;MyDataSource&quot;>
<CFSET pwd = &quot;password&quot;>
<CFSET userid = &quot;username&quot;>

****************************************
Reference these global variables in your queries as:
<CFQUERY
NAME=&quot;MyQuery&quot;
DATASOURCE=&quot;#dsn#&quot;
USERNAME=&quot;#userid#&quot;
PASSWORD=&quot;#pwd#&quot;>
{(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)}
</CFQUERY>

I don't know if this is the most elegant way to do it or not, but it works.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top