VB6 ADO - Proper use of recordset state property and connection state
Posted on 2007-08-04
In VB6 using ADO, do you get an error message if you try to close a recordset that is not open?
Dim cn As ADODB.Connection, rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
'---> later in same procedure rs.Close
Set rs = Nothing
i.e. is it necessary to use the If rs.state = adStateOpen then rs.close ??
Also, what happens if I try to close a connection to an access mdb (ado) that is not open?
example ---> Call CloseDBConnection(cn)