I have several SQL Server ODBC data sources for different databases used by a software package I do user support for. The databases are CPM_DUN, CPM, CPM_HAM, and CPM_BOP. All the data sources look fine, and pass the connection tests. I've checked them very thoroughly for any differences, and found none other than (as intended) the database name itself.
However, the data source for the CPM_HAM database is retrieving data from the CPM database when I run a query against it using MS Query from Excel. In fact, when I manually tell it to run the SQL:
select main_menu from f_system
and go back to edit the SQL, MS Query has changed it to be:
SELECT f_system.MAIN_MENU
FROM CPM.dbo.f_system f_system
As you can see, it's accessing the CPM database instead of the CPM_HAM database, which is wrong.
When I do the same thing using my data source for CPM_DUN, there's no issue - the query works fine and is updated to be:
SELECT f_system.MAIN_MENU
FROM CPM_DUN.dbo.f_system f_system
Which is correct.
Start Free Trial