option explicit Dim objConn, strState, strConnectionString ' Set the connection string on the following line: strConnectionString = "DSN=Test123;Uid=system;Pwd=password;" Set objConn = CreateObject("ADODB.Connection") 'init objConn.Open strConnectionString Select Case objConn.State Case 0 'The object is closed strState = "The object is closed" Case 1 'The object is open strState = "The object is open" Case 2 'The object is connecting strState = "The object is connecting" Case 4 'The object is executing a command strState = "The object is executing a command" Case 8 'The rows of the object are being retrieved strState = "The rows of the object are being retrieved" End Select MsgBox "Connection state: " & strState Set objConn = Nothing ' cleanup