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
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

CSmith

Well-known Member
Joined
Jan 13, 2020
Messages
686
Office Version
  1. 365
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Mobile
  3. Web
Can you show screenshot of before and after? It will usually only change if you make one.
 

ajetrumpet

Banned for being rude
Joined
Apr 12, 2008
Messages
569
Office Version
  1. 365
  2. 2016
  3. 2007
Platform
  1. Windows
curious....what's the source of the ODBC?
 

RBGDaboys

New Member
Joined
Jul 18, 2007
Messages
33
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,426
Messages
5,601,595
Members
414,462
Latest member
StageRiis

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
Top