Skip site navigation (1) Skip section navigation (2)

How to check if a connection is alive ?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-odbc(at)postgresql(dot)org
Subject: How to check if a connection is alive ?
Date: 2004-01-14 03:29:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc

Access 2000
Postgresql 7.4.1
newest PG-ODBC

how can I check if a DAO- or ADO-connection is still alive ?
I'd like to maintain a connection to a remote PG server within my VBA code.
It should be opend when the users start the application and closed when 
the app terminates.
There are longer times while the application is idle and then some times 
when it hits the server very often.

E. g. I write a log in the DB where the app says who did when what.
I'd prefer not to strain the server and the LAN with permanent Conn 
Open/Close sequences.

There will be at least one external user who enters the LAN via a SSH 
tunnel over the internet.
This connection is naturally worse in responsivity than the internal LAN 
and there are chances that the tcp/ip connection breaks or the ODBC 
times out.

If Access runs into a stale connection it plays dead until it's ODBC 
timer runs out and that can take a while.
It would be better if I could check somehow wether the connection is 
still there, before sending a command over it.

Is there a way to do that ?


pgsql-odbc by date

Next:From: Richard HuxtonDate: 2004-01-14 09:06:18
Subject: Re: How to check if a connection is alive ?
Previous:From: Rean GriffithDate: 2004-01-13 15:36:29
Subject: executing insert sproc returns -1 rows affected even though new row inserted

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group