A
Anthony
What will happen if I write this line:
db.close
in a sub procedure, when I didn't actually open the database?
Example:
Sub MyProc()
Dim db as Database, rs as Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("MyTable")
With rs
'Do something
End With
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Sub
Notice the line: db.Close. Does this line need to be there? If not, does
the execution of this line cause the database to run slow?
db.close
in a sub procedure, when I didn't actually open the database?
Example:
Sub MyProc()
Dim db as Database, rs as Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("MyTable")
With rs
'Do something
End With
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Sub
Notice the line: db.Close. Does this line need to be there? If not, does
the execution of this line cause the database to run slow?