IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

Advanced
-Collapse +Expand ASP Classic Store

Prestwood eMagazine

May Edition
Subscribe now! It's Free!
Enter your email:

   ► KBWebsite Scri...ASP Classic   Print This     
  From the February 2010 Issue of Prestwood eMag
 
ASP Classic:
ADO Objects must be explicitly closed
 
Posted 17 years ago on 12/6/2002
Take Away: Setting ADO objects to Nothing without first closing them might cause ASPMail to fail

KB100079



While normally freeing an object will perform the necessary destruction, such as calling a Close() method, this cannot be relied on with ADO objects. Microsoft warns to always close recordsets and connections prior to freeing them, eg, in VbScript:

  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
If the Close() is being called when it's uncertain whether the object is open, you can mask the "already closed" exception by add a resume next:
  on error resume next
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
  on error goto 0

If errors cause a page to abort without causing the close and free, these resources will remain open until they timeout. This may cause ASPMail to stop functioning, although the mechanism is unknown.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
176056 INFO: ADO/ASP Scalability FAQ


Comments

0 Comments.
Share a thought or comment...
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1213A1
Enter key:
KB Post Contributed By Kim Berry:

Kim Berry is an experienced coder currently specializing in VS.Net C# coding of WinForm and WebForm applications. Kim currently works part time for Prestwood IT Solutions and participates in this online community when time allows. Kim worked fulltime at Prestwood Software for four years and is still available for part time evenings and weekends work. He was one of the main Prestwood developers developing ASPSuite and has coded in many languages including C, Visual Basic, Delphi, and Visual Studio.Net.

Visit Profile

 KB Article #100079 Counter
5396
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2019 Prestwood IT Solutions.   [Security & Privacy]