Close or Nothing? 
Author Message
 Close or Nothing?

Is it right to set global database object to Nothing instead of using
"Close" method?

Here is what Microsoft help says:
"An alternative to the Close method is to set the value of an object
variable to Nothing (Set dbsTemp = Nothing)."

Thanks
Slava



Fri, 21 Sep 2001 03:00:00 GMT  
 Close or Nothing?
Slava,

When it comes to database objects I always close the object and then set it
to Nothing. This way I am sure it closes down properly and the memory used
is released. I know there has been problems previously with setting a
database object to nothing without closing it, because open recordsets could
possibly be corrupted and there were other issues. This has probably been
fixed, but I still think this approach makes sence.

Any comments appreciated.

--
HTH

VB-Joker
MCSE

PLEASE post ALL replies to newsgroup!

Quote:
> Is it right to set global database object to Nothing instead of using
> "Close" method?

> Here is what Microsoft help says:
> "An alternative to the Close method is to set the value of an object
> variable to Nothing (Set dbsTemp = Nothing)."

> Thanks
> Slava



Sat, 22 Sep 2001 03:00:00 GMT  
 Close or Nothing?
Thanks for response.

Whant do you think about this code:

  If Not (gdb Is Nothing) Then
     gdb.Close
    Set gdb = Nothing
 end If

gdb - global database object
Is this right to test gdb in this way?

 Thanks
 Slava



Sat, 22 Sep 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Close vs Nothing + CurrentDB vs DBEngine

2. rst.close vs set rst = nothing

3. db, ws= nothing / rst.close

4. rs.close or set rs = nothing

5. db.close or set db = nothing or togheter

6. Nothing vs Close

7. Recordset object Close vs. Nothing

8. Nothing vs. Close

9. Nothing or Close, Which one

10. Nothing working to automate close or unload

11. Forms Close ('X') Button Does Nothing

12. form = nothing on close

 

 
Powered by phpBB® Forum Software