Ensure that an ADO connection is closed and its object destroyed


Q: In my programme there are many alternative routes through the procedures. I use an ADO Connection, which I try to close and destroy immediately after interacting with the data. I want to add some safeguard code at the end, though, which achieves that, in case execution follows a path which I have not thought of. 

A.The following code will close a connection if it is open and destroy the connection object if it exists

If Not cn Is Nothing Then               'The connection object exists
  If Not cn.State = adStateClosed Then  'It is open
    cn.Close                            'Close it
  End If
  Set cn = Nothing                      'Destroy the object
End If