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