On 3/28/07, Darmawan Sugiarto <[EMAIL PROTECTED]> wrote:
hello guys...
I used PostGreSQL 8.0.3 and WIn32

I try to connect my first project with Lazarus to PostGreSQL but there is an
error..."EDatabaseError" -> could not translate host name "172.0.0.1" to
address: Unknown host...
Here my simple code

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
     PQConnection1.HostName:='127.0.0.1';
     PQConnection1.UserName:='superuser';
     PQConnection1.Password:='admin';
     PQConnection1.Open;
end;

You could try to set the hostname to 'localhost'  instead of '127.0.0.1'  .
Or specify the ip address of your ethernet card  ( by default  PostgreSQL
accepts only local connections ).

But first of all,  you should make sure that PostgreSQL accepts TCP/IP
connections .  Are you able to connect with :
psql  -h  127.0.0.1  -U user   database_name
?

Also : (this may not work in Win32) in Linux it is possible to leave
the hostname
empty , which means that the program will connect to postgresql using
local sockets (which don't exist on windows).


Thanks

 ________________________________
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.




--
Adrian Maier

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to