Solved

Error querying table in multiple databases

Posted on 2010-09-12
2
371 Views
Last Modified: 2012-08-13
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

0
Comment
Question by:WestCoast_BC
2 Comments
 
LVL 10

Accepted Solution

by:
js_vaughan earned 500 total points
ID: 33657312
You will need to remove those spaces in the list.
0
 

Author Comment

by:WestCoast_BC
ID: 33657356
Thank you!  I wish I had figured that out an hour ago.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question