Wine Odbc Connection to Local Postgresql Database

Wine Odbc Connection to Local Postgresql Database

I'm running PostgreSQL server which I want to access from program under wine. I installed necessary wine software to be able to make ODBC connection.

But is it possible to access local PostgreSQL server from wine?
Or is my approach wrong, and there is perhaps better way?

2 Answers

This turned almost strait-forward. ODBC backend seems supported just for 32-bit wine prefix. So if running 64-bit Ubuntu, default prefix will be 64-bit, and these are necessary steps to install ODBC support:

  1. create 32bit wine prefix (if it doesn't exist):

    WINEPREFIX="/home/zetah/prefix32" WINEARCH='win32' wine 'wineboot'
    
  2. install necessary libraries:

    WINEPREFIX="/home/zetah/prefix32" winetricks jet40 mdac28
    
  3. install the program that needs ODBC in this prefix

  4. after downloading 32-bit ODBC driver from install it:

    WINEPREFIX="/home/zetah/prefix32" wine msiexec /i psqlodbc.msi
    

After this accessing local PostgreSQL server should be possible inside wine program through ODBC.

0

The answer of zetah is alwys good, but there is a potential problem with some versions of winetrick that have for effect that the dialog box of odbcad32.exe is not displayed. The workaround is by setting 'odbccp32' to 'native,builtin' via 'winecfg'.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.