Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to check if physical connection to the database exists

564 views
Skip to first unread message

Jaspreet

unread,
Nov 12, 2009, 3:28:48 PM11/12/09
to
If we are connected to a SQL Server database through ODBC in
a powerbuilder application using a transaction object, and
the physical connection to the database is lost by, say,
unplugging the network cable, is there a way to detect that
the connection is no longer available without running a
query through the transaction object? Is there an event that
is fired or something like a timeout in the transaction
object?

Chris Pollach

unread,
Nov 13, 2009, 7:47:42 AM11/13/09
to
Hi Jaspreet;

I typically do things like:

1) Check to see if the DBHandle ( ) is correct for SQLCA.
2) Execute something simple like ... Select @version;
- then check the DB return code.

Try the above on an NVUO running on a timer. If either fail - use
Disconnect/Connect to re-establish the DBMS connection.

HTH

--
Regards ... Chris
ISUG - NA RUG Director
Blog: http://chrispollach.pbdjmagazine.com
SourceForge: http://sourceforge.net/projects/stdfndclass


<Jaspreet> wrote in message news:4afc7000.7b7...@sybase.com...

0 new messages