hi there....
my friend believes that no matter if you write this code::
cn.close
set cn = nothing
rs.close
set rs = nothing
but I believe that it's not logical....what do you mean?
Printable View
hi there....
my friend believes that no matter if you write this code::
cn.close
set cn = nothing
rs.close
set rs = nothing
but I believe that it's not logical....what do you mean?
Hi,
if recordset/Connection is open, it will get closed and destroyed, and if it is already closed, then it will just get destroyed.
so better to destroy the objects while closing...
--
Venkat
no I mean the sequence order of closing them.....do you agree with it? First closing connection the closing recordset?
Using the Close method to close a Connection object also closes any active Recordset objects associated with the connection. A Command object associated with the Connection object you are closing will persist, but it will no longer be associated with a Connection object...
(ie.,) its ActiveConnection property will be set to Nothing....
So
cn.close
set cn = nothing
will close rs and no point in closing the RS.