Solved

Error querying table in multiple databases

Posted on 2010-09-12
2
368 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now