I have installed QGIS Desktop (latest one: 3.4.3 Madeira) along with the unixODBC-dev for SQL Server 2017 (following instructions here). I used sqlcmd from msql-tools and successfully connected to the database server. I opened QGIS Desktop and when I tried to connect to an MSSQL database I received the following message:
Warning: QSqlDatabase: QODBC driver not loaded
Warning: QSqlDatabase: available drivers: QSQLITE QSPATIALITE
I went searching for a driver and I found out that I am supposed to build the driver (!).
Assuming that QGIS Desktop is loading the available drivers from /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers
, I wen on and installed Qt5.10.1, built the ODBC driver using these instructions and copied the resulting libqsqlodbc.so
to the /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers
.
This directory now contains the following:
-rw-r--r-- 1 root root 65048 Apr 12 2018 libqsqlite.so
-rwxr-xr-x 1 alas root 123784 Jan 4 20:03 libqsqlodbc.so*
-rw-r--r-- 1 root root 71832 Dec 22 06:50 libqsqlspatialite.so
I run again QGIS Desktop, I tried again to connect to the database server and I got again the same error.
My questions are:
a. Is there an easy way to add the QODBC driver to QGIS Desktop?
b. Am I doing something wrong above?
c. IS THERE ANY way to make QGIS Desktop in linux work with a SQL Server???