ADO - rs.Close or set rs=nothing
which one is better?
if i set RS = Nothing do i have to
put
before i can use this record again?Code:Set RS = New ADODB.Recordset
thanks
Printable View
ADO - rs.Close or set rs=nothing
which one is better?
if i set RS = Nothing do i have to
put
before i can use this record again?Code:Set RS = New ADODB.Recordset
thanks
I always use both when closing ...
I also always "set rs = new adodb.recordset" when re-using a recordset.Code:rs.Close
set rs = Nothing
Hi again kovan
Yes if you set it to nothing you have to re-set it.
if you need to use the recordset again, use rs.close and when you come to terminate your app, then set it to nothing
Ian
Kovan
i found this useful to close recordsets without erros
I f I have any recordsets in a project I just create a function with the above for each recordset, database, workspace, then I know every thing has been closed properly.Code:
If Not rstTemp Is Nothing Then
rstTemp.Close
Set rstTemp = Nothing
End If