aseelbathery
02-11-2007, 08:40 AM
i need to retrieve the anchor links from the database according to the querystrings of the id taken from the database.when i execute this code i get the following error
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/tc/machinery.asp, line 28.
Here is my code.
---------------
<%
Dim Ors,id
Dim category_name
Set Ors = Server.CreateObject("Adodb.Recordset")
Ors.Open "SELECT tbl_subcategory.subcategoryName FROM tbl_subcategory,tbl_postproducts WHERE tbl_subcategory.subcategoryID=tbl_postproducts.subcategoryID",cnnDB
query_id = Ors.Fields("tbl_postproducts.subcategoryID") // Here is the error i'm getting
'Response.Write id
%>
<div class="sub_category_list">
<%do until Ors.EOF
for each x in Ors.Fields
%>
<% Response.Write("<a href="&x.value&"?id="&query_id&" onclick=goto())>" & x.value & "</a>"&"<br>")%>
<%
next
Ors.MoveNext%>
<%loop
Set Ors = Nothing
%>
Can anybody help me?
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/tc/machinery.asp, line 28.
Here is my code.
---------------
<%
Dim Ors,id
Dim category_name
Set Ors = Server.CreateObject("Adodb.Recordset")
Ors.Open "SELECT tbl_subcategory.subcategoryName FROM tbl_subcategory,tbl_postproducts WHERE tbl_subcategory.subcategoryID=tbl_postproducts.subcategoryID",cnnDB
query_id = Ors.Fields("tbl_postproducts.subcategoryID") // Here is the error i'm getting
'Response.Write id
%>
<div class="sub_category_list">
<%do until Ors.EOF
for each x in Ors.Fields
%>
<% Response.Write("<a href="&x.value&"?id="&query_id&" onclick=goto())>" & x.value & "</a>"&"<br>")%>
<%
next
Ors.MoveNext%>
<%loop
Set Ors = Nothing
%>
Can anybody help me?