CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft VBScript runtime (0x800A01A8) Object required: ' closing recordset

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    24
  • Date Created
    Tuesday, October 5, 2010
  • Last Updated
    Wednesday, November 17, 2010
  • This Article Has been Viewed
    2207 times
  • Short Desc
    When you open a recordset, you need to make sure that you close it. But sometimes you can close it in the wrong area of your code page.
  • Details
    When opening a Recordset, making sure that you close it is a very important part of good programming and also to help reduce the amount of resources that are used up on your site through the recordsets being closed properly.
    Sometimes we close them to early, or way past their used time, and in them rare cases, we will get errors like we have here.

     
    Microsoft VBScript runtime (0x800A01A8)
    Object required: ''
    mypage.asp, line 127
  • Recreate Issue
    To recreate this error, open your recordset and then close it in an area after its used time.


    <%
    rs.close
    %>
  • Resolve Issue
    To resolve this issue, make sure that you close your recordset in the proper place.
    Sometimes it takes a lot of trial and error to get the right closing area.

    If you are using a recordset for page.asp?site=mine
    Then you can close the recordset at the footer.asp (Create a footer.asp page and use it to close your recordsets with)

    So, you will have something like this


    header.asp
    <%
    if request.querystring("site")"mine" then
    set rs = sql.connect
    ' Here we open our recordset named: rs
    end if
    %>


    footer.asp
    <%
    if request.querystring("site")"mine" then
    rs.close
    ' Here we close our recordset named: rs for the Query of mine.
    end if
    %>


    This will make sure that it is not trying to close where it is not being used.