Dear all,
I am under Ubuntu 20.04, X86.64 with CT 7.7. When you make a new project, place a PQConnection, a SQLTransaction and try to connect at runtime with the debugger, the app crash. Without the debugger, the app run. Please see the below example. To crash, a breakpoint must be set on the line
PQConnection1.Connected := true;
Without the breakpoint, the app run. If you run to the breakpoint, then press F8, the following dialog shows:
The file "/build/glibc-eX1tMB/glibc-2.31/elf/dl-error-skeleton.c" could not be found.
Do you like to search for it?
In Design Mode, I can set all the properties for the PQConnection (host, user, password, dbName) and connect without error.
How can this be avoided? Do I need to set the property PQConnection.clientLibrary?
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, PQConnection, SQLDB, Forms, Controls, Graphics, Dialogs;
type
{ TForm1 }
TForm1 = class(TForm)
PQConnection1: TPQConnection;
SQLQuery1: TSQLQuery;
SQLTransaction1: TSQLTransaction;
procedure FormActivate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.frm}
{ TForm1 }
procedure TForm1.FormActivate(Sender: TObject);
begin
if PQConnection1.Connected = false then begin;
PQConnection1.DatabaseName:= 'kaluga';
PQConnection1.HostName:= 'localhost';
//pgCon.port ??
PQConnection1.UserName:='kaluga_admin';
PQConnection1.Password:='kaluga_admin';
PQConnection1.Connected := true;
SQLTransaction1.Active:= true;
showMessage('connected to postgres DB');
end;
end;
end.
Thanks