1
votes

I'm experiencing problems to access PostgreSQL 11, 64 bit edition using FireDac in Delphi 10.3 (32 bit) Community edition. I do have libpq.dll in the folder containing the executable.

However, I get the following error message:

[FireDAC][Phys]-314. Cannot load vendor library [libpg.dll]. The specified module could not be found Hint: check it is in the PATH or application EXE directories, and has x86 bitness.

I worked thru Embarcardero's notes: http://docwiki.embarcadero.com/RADStudio/Rio/en/Connect_to_PostgreSQL_(FireDAC) and even downloaded the 32 bit version of libpq.dll from http://www.dlldownloader.com/libpq-dll/download/dc193c20ee9b0ba03a6e5cb7d94eca6d/

I have no problems using Unidac drivers between Delphi 10.3 (32 bit) Community edition and PostgreSQL (64 bit) but my intension is to use TMS Remote DB and TMS XData and their examples use FireDac to Microsoft database products.

Any help in solving this FireDac/Postgres problem will be much appreciated.

Regards,

Nols Smit

2

2 Answers

9
votes

1) Download x86-32 binaries as zip archive from official site: Download PostgreSQL Binaries

2) Extract zip and copy this files from pgsql/bin to your application directory:

libcrypto-1_1.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
libssl-1_1.dll
psql.exe <-- this file is needed for the test only (see below)

3) Download and install Visual Studio 2013 runtime package for x86: Visual C++ Redistributable Packages for Visual Studio 2013

4) Open windows command prompt, navigate to the folder where you copy libs and run this command: psql --version. If it prints version, then everything is Ok and now, you can run you application and connect to the PostgreSQL database.

1
votes

I use the Firedac libraries with MySQL not PostgreSQL, however you probably need to set vendor library in FDPhysMySQLDriverLink.

FDPhysMySQLDriverLink1.VendorLib := "path to  library /libpq.dll";