Page 1 of 1

[solved] Connection to Postgres failed.

Posted: 29.12.2020, 20:28
by Michl
Hi,

hope it's not a FAQ, but I don't found a answer yet.

I already asked in German Lazarusforum: https://www.lazarusforum.de/viewtopic.php?f=17&t=13323

I've tried to update a project with a newer Zeos.

In a minimal example I try following:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  FZConnection := TZConnection.Create(Self);
  FZConnection.Database        := ###;
  FZConnection.LibraryLocation := 'C:\Program Files\PostgreSQL\10\bin\libpq.dll';
  FZConnection.Password        := ###';
  FZConnection.Properties.Text := 'Undefined_Varchar_AsString_Length=255';
  FZConnection.Protocol        := 'postgresql-9';
  FZConnection.User            := ###;
  FZConnection.Connect;
end;
Testing with Zeos Trunk, old versions are running, after revision 4474 libpq.dll isn't found anymore:
None of the dynamic libraries can be found or is not loadable: libpq.dll! Use TZConnection.LibraryLocation if the location is invalid.
What I am missing? Thank you

Re: Connection to Postgres failed.

Posted: 30.12.2020, 11:30
by marsupilami
Hello Michl,

postgresql-9 isn't a valid protocol anymore on Zeos 8.0. What happens if you use 'postgresql'? Or are you on Zeos 7.2?

Best regards,

Jan

Re: Connection to Postgres failed.

Posted: 30.12.2020, 13:50
by Michl
Yeah cool! That's it. Thank you very much! Now it is working again.