Item cannot be found in the collection corresponding to the requested name or ordinal
-
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 IfIf Request.Form("TypeSearch") = "Callno" Then
Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Author" Then
Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Title" Then
Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "ISBN" Then
Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Publisher" Then
Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Binding" Then
Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Subject" Then
Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Keyword1" Then
checkkeyword="True"
Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Article" Then
checkarticle="True"
Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
End IfSet rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
If checkkeyword="True" then
rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3<%End If
End If
End IfHow i solve this error i check almost all the solution in google but not find any change. plz help
-
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 IfIf Request.Form("TypeSearch") = "Callno" Then
Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Author" Then
Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Title" Then
Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "ISBN" Then
Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Publisher" Then
Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Binding" Then
Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Subject" Then
Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Keyword1" Then
checkkeyword="True"
Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Article" Then
checkarticle="True"
Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
End IfSet rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
If checkkeyword="True" then
rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3<%End If
End If
End IfHow i solve this error i check almost all the solution in google but not find any change. plz help
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.
-
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 IfIf Request.Form("TypeSearch") = "Callno" Then
Sqlbooks = Sqlbooks & " WHERE Call_No LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Author" Then
Sqlbooks = Sqlbooks & " WHERE Author LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Title" Then
Sqlbooks = Sqlbooks & " WHERE Title LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "ISBN" Then
Sqlbooks = Sqlbooks & " WHERE ISBN LIKE '%" & _
Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Publisher" Then
Sqlbooks = Sqlbooks & " WHERE Publisher LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Binding" Then
Sqlbooks = Sqlbooks & " WHERE Binding LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Subject" Then
Sqlbooks = Sqlbooks & " WHERE Subject LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Keyword1" Then
checkkeyword="True"
Sqlkeyword = Sqlkeyword & " WHERE Keyword1 LIKE '%" & Request.Form("DaInBox") & "%'"
End IfIf Request.Form("TypeSearch") = "Article" Then
checkarticle="True"
Sqlarticle = Sqlarticle & " WHERE Article LIKE '%" & Request.Form("DaInBox") & "%'"
End IfSet rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
If checkkeyword="True" then
rsGlobalWeb.Open Sqlkeyword, dbGlobalWeb, 3<%End If
End If
End IfHow i solve this error i check almost all the solution in google but not find any change. plz help
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!!
-
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!!
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.
-
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.
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!!