|
-
Oct 5th, 2000, 08:21 AM
#1
Thread Starter
Hyperactive Member
Which of the following is appropriate for closing an ADO connection or are both equivalent?
1.
MyConnection.close
Set MyConnection=Nothing
2.
Set MyConnection=Nothing
-
Oct 5th, 2000, 08:29 AM
#2
Hyperactive Member
Closing Connections
No, they are not equivalent. #2 may be okay, you only set the connection back to nothing but you didn't close the connection. Therefore the connection is still active and that might cause problems down the line in the application.
Hope this helps.
-
Oct 5th, 2000, 04:03 PM
#3
Lively Member
In my projects, I've never used Myconnection.close before using Set Myconnection = Nothing. However, when I checked back to the server, the connection was terminated. Therefore, I think it doesn't matter whether you close the connection before destroying the object or not. In other words, when you set the object = nothing, it means you destroy it. As a result, everything should be destroyed.
-
Oct 5th, 2000, 11:59 PM
#4
Thread Starter
Hyperactive Member
Thanks vbuser and sanon. Well I guess a confirmation from the gurus at Microsoft would put to rest all our doubts. Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|