all groups > sql server connect > july 2005 >
You're in the

sql server connect

group:

Using VB6 is there a way to determine if an SQL2000 connection object is still online without closing and re-opening it?


Using VB6 is there a way to determine if an SQL2000 connection object is still online without closing and re-opening it? William Hildebrand
7/29/2005 2:40:06 PM
sql server connect:
Hello,

I have a VB6 application that connects to an SQL2000 database on another
machine. I'd like to be able to determine if the connection is still good
without having to close and re-open the database and check the error status
of the open command. The state property of the connection object is of no
use since it only reports the state as of the last time I opened or closed
the connection rather than the CURRENT state of the connection. Even if I
try to open a recordset using the connection and it fails because the
connection is no longer good it still doesn't change the state property of
the connection object.

I know there are other ways to avoid closing and re-opening the connection
object in my program, but I'm just curious mostly. Thanks to anyone who can
answer this question.

William Hildebrand
wahilde@cableone.net


Re: Using VB6 is there a way to determine if an SQL2000 connection object is still online without closing and re-opening it? Sue Hoegemeier
8/1/2005 8:27:22 PM
You'd need to run a query that doesn't hit hard or write the
app to handle a possible broken connection or things along
those lines. ADO doesn't monitor the state of the
connection.

-Sue

On Fri, 29 Jul 2005 14:40:06 -0600, "William Hildebrand"
[quoted text, click to view]
AddThis Social Bookmark Button