Connection Status

Connection Status

Post by Rommel the iCeMA » Sun, 15 Jul 2001 00:32:45

Hi folks,
    I wrote a short VB program that connects over my LAN to SQL Server 2000
(using ADO's Connection object). I'm polling the connection status at
regular intervals by getting the value of MyConnection.State, however, this
is not alwayz accurate. If, for example, I go to the NT server and stop the
SQL Server service (MSSQLSERVER) MyConnection.State does not change!!!!! It
stills thinks it's connected (State = adStateOpen) ... why???

    How can I accurately determine if I'm connected to the server???

Rommel the iCeMAn


Connection Status

Post by Patrick Loga » Sun, 15 Jul 2001 02:30:29

Might try the logical And(ing) of the bits...

If (connection.State And adStateOpen = adStateOpen) Then

End If

Not sure if this is your issue or not...
Patrick Logan, MCSD

Opinions expressed are my own and not necessarily those of my employer.


1. checking the connection status from VC++

I'm using SQL Server from my VC++ project.
The connection to the database makes in the initial of the
So, it can be that during the running, the connection
stops from some reasons.
How do I check the connection status? Where is the best
place to check it?


2. spooling from PL/SQL

3. Checking connection status with CDatabase->IsOpen() in MFC

4. I have a problem with VARRAYS / OBJECT TYPES

5. connection status

6. Inserting pictures depending on a field value

7. Connection Status

8. Implementing MoveFirst, MoveLast, MovePrevious, MoveNext in VB6.0 and SQL Server 6.5

9. ADO Connection Status Property

10. Checking Connection Status in a Pro*C program

11. show connection status?

12. Determining connection status and Oracle id