N
Nick 'The Database Guy'
People,
I have a piece of code (please see below) and after I assign the
value, which I look up in a recordset, to a variable I close the
recordset and set both the object variables to equal nothing.
Dim intAutth As Integer
sql = "SELECT Authority " & _
"FROM tblUsers " & _
"WHERE Login =" & Environ("UserName")
Set db = CurrentDb
Set rs = db.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
intauth = rs!Authority
rs.Close
Set rs = Nothing
Set db = Nothing
My question is this: Is it best practise to set both variables to
equal nothing or would setting the 'db' to nothing do exactly the same
job?
Thanks in advance.
Nick
I have a piece of code (please see below) and after I assign the
value, which I look up in a recordset, to a variable I close the
recordset and set both the object variables to equal nothing.
Dim intAutth As Integer
sql = "SELECT Authority " & _
"FROM tblUsers " & _
"WHERE Login =" & Environ("UserName")
Set db = CurrentDb
Set rs = db.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
intauth = rs!Authority
rs.Close
Set rs = Nothing
Set db = Nothing
My question is this: Is it best practise to set both variables to
equal nothing or would setting the 'db' to nothing do exactly the same
job?
Thanks in advance.
Nick