I am using a FPC 3.0.0 and also I have instaled pgAdmin III version 1.22
Just for test, I copied all DLL from "C:\Program Files (x86)\pgAdmin III\1.22" to "C:\FPC\3.0.0\bin\i386-win32"
I tried change my code to use TPQConnection, as sugested our friend SkyKhan.
now my dirt source code is:
program adtopg;
uses sysUtils, classes, sqldb, db, pqconnection, bufdataset, sqlscript;
var
pgConnection : TPQConnection;
pgTransaction : tSQLTransaction;
pgQuery : tSQLQuery;
begin
pgConnection := TPQConnection.create(Nil);
try
pgConnection.hostName := '130.1.0.100:5432';
pgConnection.databaseName := 'wgusers';
pgConnection.userName := 'lion';
pgConnection.password := 'xyz123';
pgConnection.charSet := 'utf-8';
pgTransaction := tSQLTransaction.create(pgConnection);
pgConnection.transaction := pgTransaction;
pgConnection.open;
pgTransaction.database := pgConnection;
pgTransaction.startTransaction;
{pgConnection.connected := TRUE;}
pgQuery := tSQLQuery.create(pgConnection);
pgQuery.database := pgConnection;
pgQuery.transaction := pgTransaction;
pgQuery.SQL.text := 'select DISPLAY_NAME from public.ad;';
pgQuery.open;
while not pgQuery.EOF do begin
writeln(pgQuery.fieldByName('DISPLAY_NAME').asString);
pgQuery.next;
end;
finally;
pgQuery.close;
end;
pgConnection.free;
end.
... AND in the line "pgConnection.open;" I am getting ERROR:
The ordinal 2497 could not be located in the dynamic link library C:\FPC\3.0.0\bin\i386-win32\libpq.dll.
I try to find some information about this error in the web, but I did not found.
Is someone got this error?
How could I fix it?
Thanks,
Valerio Pregnolato from Brazil.