Never happened to me.  I think this setup is very common (having a 
single SQLSERVER, and creating multiple DSNs to different databases), 
someone would have run into it.

Try dumping SELECT @@SERVERNAME, DB_NAME() to see if you really are 
connected to the correct DB

Do you have code that do <cfquery>USE Banana</cfquery> that switches 
your database from Apple to Banana?  Once you switch, and CF reuses that 
connection you will be on that database.

Try using the same DSN settings (username, password, database) in SQL 
Server Management Studio and see if you get the same issue.

Do your DSNs use different user accounts? Make sure they're pointing to 
the correct ones.


On 2/10/2011 10:03 AM, Matt Williams wrote:
> Basics: Windows 2003 server, CF 7.0.2, SQL Server 8
>
> Multiple datasources, but lets specifically look at the ones named Apple and 
> Banana. They point to separate databases on the same SQL server, connecting 
> to db Apple and db Banana respectively, as expected. However, occasionally, 
> datasource Apple gets mixed up and attempts to use db Banana.
>
> At first my error reported the following:
> Datasource: Apple
> Detail: [Macromedia][SQLServer JDBC Driver][SQLServer]Invalid object name 
> 'dbo.company'.
>
> After verifying the table did indeed exist, I did a simple cfquery to return 
> the tables that do exist in datasource Apple. This query returned the tables 
> from database Banana! I double and triple checked the datasource in the CF 
> Administrator. It is correctly set to Apple.
>
> This is happening on our dev server. My solution thus far has been to create 
> a new datasource called Apple_tmp. It seems to work. I did try to then delete 
> Apple and rename Apple_tmp back to Apple, but it soon had the same issue. 
> Ahhhh!
>
> My suspicions are some DNS or IP funkiness but have yet to track that down. 
> This is all on one physical box, so I don't know if that would be it or not. 
> I'm mainly curious if anyone else has seen this.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342123
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to