I.T. Discussion Community!
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

-Collapse +Expand ASP Classic Store

Prestwood eMagazine

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

   ► KBWebsite Scri...ASP Classic   Print This     
Next Random Article Next Random Tidbit || Change Topic Random From All
  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


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:

  set rs=nothing
  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
  set rs=nothing
  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


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 = P1194A1
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
Since 4/2/2008
Follow PrestwoodBoards on: 

©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech