Link to home
Create AccountLog in
Avatar of WestCoast_BC
WestCoast_BCFlag for Canada

asked on

Error querying table in multiple databases

I am trying to query the same table in multiple databases.  When my code attempts to query the second database in my list I get the following error:
        Datasource DB1 could not be found.

If I change the order in my DSNList my code always fails at the second database.  
<cfset DSNList = "db1, db2, db3">

<cfloop list="#DSNList#" index="defDSN" delimiters=",">
	<cfoutput>
	[#defDSN#]:
	</cfoutput>
	<CFQUERY NAME="getCategory" DATASOURCE="#defDSN#">
		SELECT      *
		FROM        thread_categories
	</cfquery>
	
	<br />
</cfloop>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of js_vaughan
js_vaughan

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of WestCoast_BC

ASKER

Thank you!  I wish I had figured that out an hour ago.