UnixODBC (FireDAC)

From RAD Studio
Jump to: navigation, search

Go Up to Multi-Device Development (FireDAC)

General

FireDAC on Linux and macOS uses UnixODBC to access:

FireDAC uses libodbc.so or the .dylib shared library to get access to ODBC API. Normally, it is located in the /usr/local/lib folder.

Installation

Often, the UnixODBC installed with OS may be:

  • outdated, as on most Linux distros;
  • not configured properly, as on most Linux distros;
  • or not installed, as on macOS.

So, if UnixODBC is installed, we recommend to reinstall it, although it is optional step.

You should decide which UnixODBC version to use and how to install it:

  • On macOS:
    • Use UnixODBC v 2.3.0 if you are not experienced with macOS.
    • Use the latest UnixODBC v 2.3.4 if you are experienced with macOS.

Install on Linux

To install UnixODBC on Linux, use the commands:

sudo apt-get remove libodbc1 unixodbc unixodbc-dev
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
tar -zxvf unixODBC-2.3.4.tar.gz
cd unixODBC-2.3.4
./configure --enable-gui=no --enable-drivers=no --enable-stats=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE
make
sudo make install
cd ..

Install on macOS

To install UnixODBC on macOS, use the following commands:

export CFLAGS=-m32
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
tar -zxvf unixODBC-2.3.4.tar.gz
cd unixODBC-2.3.4
./configure --enable-gui=no --enable-drivers=no --enable-stats=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE
make
sudo make install
cd ..

Additional Installation Steps

UnixODBC v 2.3.4 creates ".2" symlinks, but many ODBC drivers require ".1" symlinks. For that, manually create ".1" symlinks. For example, on Ubuntu Linux, perform the following commands:

sudo ln -s /usr/local/lib/libodbc.so.2.0.0 /usr/lib/x86_64-linux-gnu/libodbc.so.1
sudo ln -s /usr/local/lib/libodbccr.so.2.0.0 /usr/lib/x86_64-linux-gnu/libodbccr.so.1
sudo ln -s /usr/local/lib/libodbcinst.so.2.0.0 /usr/lib/x86_64-linux-gnu/libodbcinst.so.1