Re: How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?
Date
Msg-id 4D77B0DB.7030305@gmail.com
Whole thread Raw
In response to How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?  (John Edens <edensjc@sfasu.edu>)
Responses Re: How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?  (John Edens <edensjc@sfasu.edu>)
List pgsql-general
On 03/09/2011 08:30 AM, John Edens wrote:
> Hey guys, I'm trying to get a VB program to make a client connection to
> my PostgreSQL server running on an
>
> Ubuntu 10.10 server.
>
> Here's what I've done:
>
> Client side - installed and registered the OLE DB .dll's from the
> PostgreSQL OLE DB Provider project.
>
> server side -
>
> the configuration described here:
> https://help.ubuntu.com/10.10/serverguide/C/postgresql.html
>
> ---------------
>
> Have added this line to postgresql.conf:
>
> listen_addresses = '*, 144.96.80.35, localhost'

I would stick with listen_addresses = '*', this covers all the bases and
simplifies things for the time being.


>
> I've also tried this as simply:
>
> listen_addresses = '144.96.80.35, localhost'
>
> also, port = 5432
>
> --------------
>
> I have added the following to pg_hba.conf:
>
> # IPv4 local connections:
>
> host all all 144.96.80.35 255.255.255.0 md5
>
> local all postgres md5

If I am following, 144.96.80.35 is your server address not the clients.
In pg_hba.conf the IPs are those from the clients you want to let in, so
you will need to use an IP or mask that matches that of your client. To
reduce confusion you might want to do that in the section for remote
connections :)

>
> --------------
>
> I've got the following code going in VB:
>
> Public Class Form1
>
> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> Const connString As String = "Provider=PostgreSQL; Server=144.96.80.35;
> User Id=postgres;Password=postgres;"
>
> Dim theOleDBconnection As New OleDb.OleDbConnection
>
> theOleDBconnection.ConnectionString = connString
>
> theOleDBconnection.Open()
>
> End Sub
>
> End Class
>
> So when the project opens up, it should make the connection and display
> the form.
>
> What happens is that I get an error...
>
> OleDbException was unhandled
>
> could not connect to server: Connection refused (0x0000274D/10061)

Per the explanation above your client IP does not have access to the server.

>
> Is the server running on host "" and accepting
>
> TCP/IP connections on port 5432?
>
> ---------------------------
>
> So, obviously I've got something configured incorrectly.
>
> I'm troubled that the VB error seems to show a null value for the host.
> Shouldn't that be the Server value in
>
> the connection string?
>
> Thanks to all for any help…
>




--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Steve Crawford
Date:
Subject: Re: How to configure for remote TCP/IP client conncections using MS Visual Basic OLE DB calls and PostgreSQL dll's?
Next
From: "Edmundo Robles L."
Date:
Subject: about memory size reported by system.