ReportingAnalyst
MIS
I am testing my asp page against the Northwind database. I would like to see all the categories in the categories table. Why do I see 8 rows of the value "Beverages"
My code is below:
My code is below:
Code:
<%
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT CategoryID, CategoryName FROM Categories order by CategoryName"
rs.open sSQL, Conn
If not rs.EOF then
aCategory = rs.GetRows()
'Close the Recordset object
rs.Close
'Delete the Recordset Object
Set rs = Nothing
'Declare Constants for the above SQL columns for better readability
'Use these Constants instead of referring to the array numeric indexes
Const c_Cat_ID = 0
Const c_CatName = 1
CatID = aCategory(c_CatID,iRowLoop)
Dim iRows
For iRows = 0 to UBound(aCategory, 2)
%>
<ul id="menu">
<li>
<input type="radio" checked name="catid" id="catid<%=aCategory(c_Cat_ID, 0)%>" value="<%=aCategory(c_Cat_ID, 0)%>">
<a href="#" class="a_style"><%=aCategory(c_CatName, 0)%></a>
<ul id="UI_<%=aCategory(c_Cat_ID, 0)%>" style="display: none">
<%
'Call GetProducts (CatID, Counter)
%>
</ul>
</li>
</ul>
<%
Next 'iRows
End If 'rs.EOF
%>