2

I have a Qt 4 application that is trying to connect to an MS SQL Server 2008 database using the Qt ODBC driver. The application runs fine when it is running in Windows; however, the target OS for the application is to have it run in GNU/Linux. When the application runs in GNU/Linux I get the following error:

QSqlError(0, "QODBC3: Unable to connect", " [unixODBC][Driver Manager]Data source name not found, and no default driver specified")

Is there something I need to configure on the SQL server or application side to get the connection to work?

2
  • How did you fixed that? I'm really curious, as I have had the same problem and it appeared, that the mistake was very common .. Commented Nov 4, 2010 at 9:06
  • The issue seems to be that you have to create a unixODBC connection on the computer. You cannot just connect directly with the server. The tutorials in the accepted answer explains how that worked. Commented Nov 4, 2010 at 13:21

2 Answers 2

2

I don't really know much about unixODBC, but have a look here:
unixodbc.org/doc/

For connecting to MSSQL, the following might be useful:
http://www.unixodbc.org/doc/FreeTDS.html
or .../FreeTDS2.html

Sign up to request clarification or add additional context in comments.

Comments

0

Try to copy the odbc.ini file in ~/.odbc.ini . If not working again, try to copy the same file into /etc/odbc.ini. If this is not working, as these directories are different for different Unix systems, find all files: *odbc*\.ini and see if some of them are empty. If so, replace them with the correct .ini file.

I had the same problem and this solved it. But it's a really stupid solution, so I'm looking for a better one. Hope that helped (:

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.