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: 'rsSearch'

  • 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:
    43
  • Date Created
    Tuesday, November 16, 2010
  • Last Updated
    Wednesday, November 17, 2010
  • This Article Has been Viewed
    1986 times
  • Short Desc
    When using RecordSets, you must make sure that you have the CreateObject, if not this error will accure.
  • Details
    When using RecordSets in your project like a paging system, you will need to have the CreateObject for the RecordSet, if this is not supplied in the code, then you will recieve this error.

     
    Microsoft VBScript runtime (0x800A01A8)
    Object required: 'rsSearch'
    /paging.asp, line 21


    If you are using Paramaters in your code, and are working on something other than a Paging script, then this will (or) should not apply to your issue.
    As calling Parameters, you create your RecordSet like so:

    <%
    set rsSearch = sqlServer.execute
    %>


    This creates the recordset for you, so you will not need the CreateObject.
  • Recreate Issue
    To recreate this issue.

    <%
    =rsSearch("MyRecord")
    %>


    This will give you the error if you do not supply the CreateObject

    <%
    Set rsSearch=Server.CreateObject("ADODB.RecordSet")
    %>


  • Resolve Issue
    To correct write your code, in this case, we are doing a paging system, so it will look like this.

    <%
    Set searchsql = CreateObject("ADODB.Command")
    searchsql.ActiveConnection=objConn
    searchsql.Prepared = true
    Set rsSearch=Server.CreateObject("ADODB.RecordSet")
    %>


    The above will compile without the error.
    As mentioned above in the description, this issue should not be a factor if you are doing something like this.

    Parameterized Queries.

    <%
    Set searchsql = CreateObject("ADODB.Command")
    searchsql.ActiveConnection=objConn
    searchsql.Prepared = true
    searchsql.commandtext="Select record1, record2 from table1"
    set rsSearch = searchsql.execute
    %>


    The above does not need to CreateObject for the RecordSet