PC Review


Reply
Thread Tools Rate Thread

Close vs Nothing

 
 
=?Utf-8?B?RGF2ZQ==?=
Guest
Posts: n/a
 
      11th Apr 2006
Hi,
Can anyone explain the difference and benefit (if any) between using the
close statement and the Nothing statement?
For example, when I clean up at the end of a procedure:

rst.Close

OR

set rst = Nothing

Thanks
Dave
 
Reply With Quote
 
 
 
 
david epsom dot com dot au
Guest
Posts: n/a
 
      11th Apr 2006
When you set a recordset to nothing, it is supposed to
close the recordset if nothing else is using it.

When you close a recordset, it closes the recordset even
if something else is using it.

If you sensibly only use the recordset once, in one place,
then it makes no difference if you close the recordset, or
set it to nothing, or let it go out of scope.

Apart from that, there are various arguments based on coding
style, which environment you are using (asp frequently has
different scope than Access VBA), and bugs in long gone
versions of Access.

(david)



"Dave" <(E-Mail Removed)> wrote in message
news78DEC65-252E-4AF9-A7A7-(E-Mail Removed)...
> Hi,
> Can anyone explain the difference and benefit (if any) between using the
> close statement and the Nothing statement?
> For example, when I clean up at the end of a procedure:
>
> rst.Close
>
> OR
>
> set rst = Nothing
>
> Thanks
> Dave



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 Disable Close and Close All on Tabbed Documents MumHeb Windows Vista 0 6th May 2010 05:36 PM
error in running workbook.close() func. after close excel from win Kayıhan Microsoft C# .NET 0 29th Mar 2009 12:49 AM
Clear Checkbox field on close of form or close of report =?Utf-8?B?QnJvb2s=?= Microsoft Access Form Coding 2 14th Jan 2006 09:31 PM
Excel shoud not close all active books when clicking close button =?Utf-8?B?dGVjaG5vbWlrZQ==?= Microsoft Excel Misc 0 10th Jun 2005 05:35 PM
Close all programs / Shut Down windows does not auto close outlook =?Utf-8?B?TUtlcw==?= Microsoft Word Document Management 2 22nd Aug 2004 11:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 PM.