The Linux Page

[ODBC Driver Manager] Data source name not found and no default driver specified

As I was working on a MS-Windows installation, I ran in this weird error: Data source not found and no default driver specified...

This was output when I was running the following in a command line prompt:

osql -E

The result should have been an MSSQL prompt instead!

The problem on the computer was that I uninstalled MSSQL 2005 that was automatically installed by Visual Studio C++ and was not compatible with our application, so I first uninstalled that but that uninstallation is really not proper. It leaves a LOT of things behind.

After that I installed MSSQL 2014 which was reported as fully working. Then I could see that databaser server running and in my ODBC window. However, the osql command line, for some reason, kept failing.

When I looked a the error closer, I noticed that it was saying 2005 in the version of the osql command! That was it. It was running the old osql command instead of the new one.

The culprit (outside of the actual uninstall command that does not work right since it leaves tools behind!?) was the Path variable. It still included the path to the Binn directory of the 2005 version (i.e. those that included the (x86) in the path.) I removed TWO paths to the old version, and now it works fine. The correct osql tool is used and it connects instantly as expected.

Additional note: The 2005 version was a 32 bit version, the 2014 version was a 64 bit version. Also, I did not even remotely try to do an upgrade because I did not see the point having no data in the old version that was just installed there under my feet...