You can also use the following code to test the connection say cnn is your ado connection

you can use

VB Code:
  1. if cnn.state <> adStateOpen then
  2.     msgbox"Cannot open the connection"
  3. endif