0

i have made a QT Desktop application as an Appimage. On my development laptop it works fine connecting to the database flawless. But when i put the Appimage to my PC where also the MS SQL Server is hosted it does not work anymore.

My Laptop and PC are Linux Mint 19 Laptop is 19.1 and PC is 19.3 to be specific.

I have installed odbc and tds following this guide: https://help.interfaceware.com/kb/904

Ubuntu

Run the following commands using a terminal window, or the CLI:
    Get the latest package info:

    sudo apt-get update

    Install libodbc.so, libtdsS.so, isql, and isqlinst:

    sudo apt-get install unixodbc

    Install libtsdsodbc.so and tsql:

    sudo apt-get install tdsodbc

Create a file called odbc.ini

i also edited the /etc/odbc.ini like this:

    Description = MS SQL Server Driver 
    Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
    Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
    Server = 192.168.0.10
    Port = 1433

but when i run the application on the PC i always get:

    QSqlError("0", "QODBC3: Unable to connect", "[unixODBC][Driver Manager]Can't open lib 'libtdsodbc.so' : file not found")

i also checked that the library is really under the specified path: /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so yes it is really there.

so i asking what do i missing here?

help would be really appreciated

best regards

Rolf

  • Those instructions are for Ubuntu 10.04. Is there some reason you're not wanting to use the [current Microsoft ODBC 17 drivers](https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#ubuntu17)? – AlwaysLearning Jun 30 '21 at 12:47
  • thanks for mentioning, actually no. I tried that but sadly it did not solve the issue. – Rolf Hausen Jun 30 '21 at 13:55
  • Please check if the ODBC lib is inside your bundle, also make sure that this path is reachable at runtime. Which tool are you using to create the AppImage ? – Alexis Aug 24 '21 at 19:15

1 Answers1

0

I found the solution myself.

I tired to falsify the odbc.ini and the odbcinst.ini on my laptop trying to reproduce the error there i found that it did took no effect.

After searching for the libtdsodbc.so on the laptop i found it also located at /usr/local/lib/

so i copied the library from /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so to /usr/local/lib

and that solved the issue and the QT application is now working fine.