Connection to postgreSQL not possible lazarus / 16-Databases ---------------------------------------------------------------------- trinity · 2011-09-21 16:55 Hello, I want to connect to a local postgreSQL database with Zeos. When I set 'Connected=true' there is always the error 'None of the dynamic libraries can be found: libpq.dll' I already tried to copy the libpq.dll file (from the postgreSQL\bin directory) to my project directory and the C:\Windows\system32, but the error message still appears. I use Lazarus 0.9.30, Zeos 6.6.6 and PostgreSQL 9.0 Can somebody help me? (By the way, I already had the same problem when trying to connect to a local mySQL database...) ---------------------------------------------------------------------- goodname · 2011-09-21 17:00 libpq depends on many libraries. The path environment variable needs to be set up or copy all of the dll's to the run or system32 directory. The required windows libraries can be found here. http://www.enterprisedb.com/products-services-training/pgbindownload ---------------------------------------------------------------------- Silvio Clécio · 2011-09-21 20:32 To run your project in IDE, copy all DLLs to "C:\lazarus". To run your project without the IDE, copy to "C:\Folder\Of\Your\Project". Good luck. ---------------------------------------------------------------------- trinity · 2011-09-21 20:49 Thank you for your answers! If I copy all DLL's to C:\lazarus the error message 'None of the dynamic libraries can be found...' does not appear anymore. But now there is another error message: 'Access violation' Does anybody know what this means? Hostname, database name, username and password are set up and should be right.... ---------------------------------------------------------------------- Silvio Clécio · 2011-09-21 20:59 Yes. ---------------------------------------------------------------------- trinity · 2011-09-21 21:16 Quote from: silvioprog on September 21, 2011, 10:59:18 pmYes. Yes...what? ---------------------------------------------------------------------- Silvio Clécio · 2011-09-21 21:25 Oops, sorry guy. I used Alt+S ...  So, I use PostgreSQL 8.4 (Windows) and 9 (Linux). In Windows I copied all DLL's from "C:\Program Files (x86)\PostgreSQL\8.4\bin" to "C:\lazarus". And tested with demo in attached. Worked perfectly. Windows 7 (64), PostgreSQL 8.4, and Lazarus 0.9.31 r32453 FPC 2.5.1 i386-win32-win32/win64 ---------------------------------------------------------------------- trinity · 2011-09-22 08:09 If I try it like you did, there comes an error: Unkown connector type! ??? ---------------------------------------------------------------------- Silvio Clécio · 2011-09-22 10:16 You tested the my example in attached exactly as it is? Note that I declared the unit PQconnection and used protocol as "postgresql".