PDA

View Full Version : Access to a SQL SERVER database from Linux



franco.amato
14th April 2012, 06:46
Hi to all, nice the new text editor.
I wrote an application that's working under Linux, ubuntu in this case.
Unfortunately I need to interact with a MS SQL SERVER from it and I'm unable to do it working.
I read that Qt access to a microsoft sql server using odbc. I read some document in internet but I'm unable to set
it property.
Can I have some guide line or help?
Best Regards,
Franco

ChrisW67
14th April 2012, 07:32
At least give us a hint what you have tried, how far you got, what does and does not work, what documents you have read etc. We don't even know if you want to do this from the Linux machine or if the application has moved to Windows where you are most likely to deal with Microsoft's database.

To do it from Linux you will need to get ODBC for Linux working first, build the Qt ODBC plugin, and then make your program use it. To do it from Windows you can skip the first step and adjust the instructions for the QtSDK if that is what you are using. It's all in the documentation.

franco.amato
14th April 2012, 16:21
Hi Chris,
Yes the code should work on Linux not windows.
I downloaded QODBC from package manager ( synaptic ) than I copied it at binary level in this folder structure /plugins/sqldrivers/odbcdriver. Then I download from Linux a odbc driver and tried to configure but without success, I'm not sure is the correct driver and I'm sure I configured it well...
Can you point me to the right way? Can you give a link from where download the correct odbc driver for MS SQL SERVER and if you can how configure it?
Best Regards,
Franco

ChrisW67
15th April 2012, 10:24
You need to install unixODBC. You can get this from Ubuntu repositories I think.

You need to build the QODBC plugin. The instructions are in the documentation.

You need a UNIX/Linux ODBC driver for Microsoft SQL Server. I am not aware of any free driver. See http://www.unixodbc.org/

franco.amato
15th April 2012, 17:05
Hi thank you very much.
The documentation link you sent doesn't work...
Regards,
Franco

wysota
15th April 2012, 17:36
Try again now.