MS Query - Command Text value changing

RBGDaboys

New Member
Joined
Jul 18, 2007
Messages
33
I created a ODBC connection, select my table and field and dump back to Excel. All looks great.
I then go to "edit query". During the edit process when using MS Query the table sql code changes "without" me doing anything.

Ex.
1st connection command text code:
SELECT PMLD.CODE
FROM BUS12.LEB.PMLD PMLD

Try to edit the connection the command text changes when MS Query opens
SELECT PMLD.CODE
FROM BUS12.ASD.PMLD PMLD

What would cause this change to occur?
TY
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Can you show screenshot of before and after? It will usually only change if you make one.
 
Upvote 0
curious....what's the source of the ODBC?
 
Upvote 0
Thank you for the replies.

The source ODBC is SQL2017 DB.

I discovered more details and this should help.

Example of DB tables
ABC.Person
XYZ.Person
RTY.Person
YUI.Person

When I setup the initial data connection and select table RTY.Person all is good. When I go to EDIT the data connection and return to the data to Excel the command text "changes" to ABC.Person. It's seems when the tables schema's are the different but the tables are the same name AFTER the "." the first table in the list is defaulted to and changes automatically.

I hope this helps.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,576
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top