Reputation: 45
I have PostgreSQL 9.2 installed on win 7 64 and can connect to it with ODBC from my delphi IDE using dbexpress with no problem. When I try to connect using Zeos, and although I have provided the path to the libpq.dll, I still get the error (libpq not found or not loadable). I tried all solutions I found by googling but so far I haven't found a working solution. I have put the dll, and later all dlls into system32 to even see if that is what it takes.
This is my setup:
Delphi XE3 Zeos 7 PostgreSQL 9.2 On windows 7 64
Does anyone use this system and can connect to postgresql 9.2 with zeos?If so what am I missing?
So my question summarized in one line is this:
What is a working configuration/steps to connect zeos 7 with postgresql on delphi on win 7 64?
Your answer is much much appreciated!!
Upvotes: 0
Views: 5067
Reputation: 1
I had the same problem. To get around this, I had to change the working directory of the delphi application to the path of libpq.dll because otherwise it will not be able to find the other libraries, it needs. So maybe you want to do something similar to this before opening the first connection to postgresql:
OldPath := ExtractFilePath(Application.ExeName);
ChDir('c:\path\to\libpq\dll\');
ZConnection.Connect;
ChDir(OldPath)
Upvotes: 0
Reputation: 1933
Most likely the computer where the problem is happening lacks Microsoft Visual C++ 2010 Redistributable x64. I adivise you to download it from Microsoft and install it, then run another test.
Upvotes: 0
Reputation: 1695
Are you sure your ZeosLib is x64? When building component, make sure you choose 64-bit Windows as Target Platform.
Upvotes: 0
Reputation: 23
Make sure you have the following files together with libpq.dll: libeay32.dll, libiconv.dll, ssleay32.dll, libintl.dll, libxml2.dll, and libxslt.dll. These are library files that lipq.dll depends on. Delphi IDE is 32bit so you can only use the 32bit version of the above libraries if you want to connect to postgresql at design time. If your project is 64bit you may get the 64bit version of the files above and place it in a separate folder under your project's root dir then change the libpq.dll path of ZConnection at runtime to point to that folder.
Hope this helps.
Upvotes: 1