Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Item cannot be found in the collection corresponding to the requested name or ordinal

Item cannot be found in the collection corresponding to the requested name or ordinal

Scheduled Pinned Locked Moved ASP.NET
helpdatabasewpfwcfsysadmin
5 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    haleemasher
    wrote on last edited by
    #1

    I have a simple code in asp and VB which is used for search in a database (MS Access).All search are done but only one creates an error.When i search by a keyword it show this error. Error is ADODB.Recordset error '800a0cc1'.Item cannot be found in the collection corresponding to the requested name or ordinal

    <%

    Dim Sqlbooks
    dim checkkeyword, checkarticle
    checkarticle="False"
    checkkeyword="False"

    Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
    dbGlobalWeb.Open("BookDB")

    Sqlbooks = "SELECT * FROM Booklist"
    Sqlkeyword="SELECT * FROM Keyword11"
    sqlarticle="SELECT * FROM Article"

    If Request.Form("TypeSearch") = "Accno" Then
    Sqlbooks = Sqlbooks & " WHERE Acc_No LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Callno" Then
    Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
    Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Author" Then
    Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
    Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Title" Then
    Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
    Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "ISBN" Then
    Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
    Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Publisher" Then
    Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Binding" Then
    Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Subject" Then
    Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Keyword1" Then
    checkkeyword="True"
    Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    If Request.Form("TypeSearch") = "Article" Then
    checkarticle="True"
    Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
    End If

    Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")

    If checkkeyword="True" then
    rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3

    <%End If
    End If
    End If

    How i solve this error i check almost all the solution in google but not find any change. plz help

    C _ 2 Replies Last reply
    0
    • H haleemasher

      I have a simple code in asp and VB which is used for search in a database (MS Access).All search are done but only one creates an error.When i search by a keyword it show this error. Error is ADODB.Recordset error '800a0cc1'.Item cannot be found in the collection corresponding to the requested name or ordinal

      <%

      Dim Sqlbooks
      dim checkkeyword, checkarticle
      checkarticle="False"
      checkkeyword="False"

      Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
      dbGlobalWeb.Open("BookDB")

      Sqlbooks = "SELECT * FROM Booklist"
      Sqlkeyword="SELECT * FROM Keyword11"
      sqlarticle="SELECT * FROM Article"

      If Request.Form("TypeSearch") = "Accno" Then
      Sqlbooks = Sqlbooks & " WHERE Acc_No LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Callno" Then
      Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
      Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Author" Then
      Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
      Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Title" Then
      Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
      Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "ISBN" Then
      Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
      Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Publisher" Then
      Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Binding" Then
      Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Subject" Then
      Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Keyword1" Then
      checkkeyword="True"
      Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      If Request.Form("TypeSearch") = "Article" Then
      checkarticle="True"
      Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
      End If

      Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")

      If checkkeyword="True" then
      rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3

      <%End If
      End If
      End If

      How i solve this error i check almost all the solution in google but not find any change. plz help

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This is the ASP.NET forum, this looks like asp. asp has been obsolete for 7 years, why are you using it ? I recommend the web development forum for asp questions.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • H haleemasher

        I have a simple code in asp and VB which is used for search in a database (MS Access).All search are done but only one creates an error.When i search by a keyword it show this error. Error is ADODB.Recordset error '800a0cc1'.Item cannot be found in the collection corresponding to the requested name or ordinal

        <%

        Dim Sqlbooks
        dim checkkeyword, checkarticle
        checkarticle="False"
        checkkeyword="False"

        Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
        dbGlobalWeb.Open("BookDB")

        Sqlbooks = "SELECT * FROM Booklist"
        Sqlkeyword="SELECT * FROM Keyword11"
        sqlarticle="SELECT * FROM Article"

        If Request.Form("TypeSearch") = "Accno" Then
        Sqlbooks = Sqlbooks & " WHERE Acc_No LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Callno" Then
        Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
        Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Author" Then
        Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
        Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Title" Then
        Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
        Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "ISBN" Then
        Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
        Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Publisher" Then
        Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Binding" Then
        Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Subject" Then
        Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Keyword1" Then
        checkkeyword="True"
        Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        If Request.Form("TypeSearch") = "Article" Then
        checkarticle="True"
        Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
        End If

        Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")

        If checkkeyword="True" then
        rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3

        <%End If
        End If
        End If

        How i solve this error i check almost all the solution in google but not find any change. plz help

        _ Offline
        _ Offline
        _Damian S_
        wrote on last edited by
        #3

        Well, your code above refers to Keyword11, whereas the code below refers to Keyword1... perhaps there's a typo in one or the other?

        I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

        C 1 Reply Last reply
        0
        • _ _Damian S_

          Well, your code above refers to Keyword11, whereas the code below refers to Keyword1... perhaps there's a typo in one or the other?

          I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          You READ all that ? You have too much time on your hands....

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          _ 1 Reply Last reply
          0
          • C Christian Graus

            You READ all that ? You have too much time on your hands....

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            _ Offline
            _ Offline
            _Damian S_
            wrote on last edited by
            #5

            Nah, I just skimmed it, and noticed the bold sections, which may have indicated that's where the OP thought the problem was...

            I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups