Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Multiples DSNs' application.cfc

$
0
0

You can't set up multiple datasources in Application.cfc to be used **implicitly** in your queries.  The "this.datasource" can only be set to one datasource name.  However, nothing is stopping you from storing a structure of datasource names in the application scope:

 

<cfset application.myDSNs = StructNew()>

<cfset application.myDSNs.DSN1 = "myDSN1">

<cfset application.myDSNs.DSN2 = "myDSN2">

...

 

Then in your query, you would do:

 

<cfquery name="qDoctype" datasource="#application.myDSNs.DSN1#">

...

 

 

HTH,

-Carl V.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>