Postgres V 10 connection issue

I am using the code from the help pages to connect to a PG Version 10 DB. Using PGADMIN4 I connect perfectly to the windows 10 machine running the server (connects in under a second). However from Xojo the connection just times out. There are no F/W or connectivity issues as PGADMIN is running on the same client. Here is the example. Has anyone else got PGV10 working?

Dim db As New PostgreSQLDatabase
db.Host = serverip
db.Port = serverport
db.DatabaseName = databasename
db.AppName = “Productname”
db.Username = username
db.Password = password
If db.Connect Then
//proceed with database operations
session.mb “Connected”
session.mb db.ErrorMessage ’ ALWAYS GET TIME OUT ERROR MESSAGE
End If

Hi Dave,
maybe Connection type needs to be defined (e.g. db.SSLMode = PostgreSQLDatabase.SSLAllow)?
Or try without db.AppName?

I connect to PG 10.1 all day without trouble (not using a windows server though). Did you check the PG log file? Can you ping the server at all?