客户端显示数据的排列问题
有关联的两个表aa和bb,(aa为商品种类,bb为商品名称)
怎样才能在客户端显示以下这样的数据排列呢?
种类:水果
商品:苹果、香蕉、菠萝
种类:蔬菜
商品:冬瓜、南瓜、西瓜、北瓜
种类:零食
商品:花生、饼干、瓜子
我想了很久的源代码,可是总是不能按照我的要求排列,请问谁能帮帮我??
源代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/mydb.asp" -->
<%
Dim Rs1
Dim Rs1_numRows
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.ActiveConnection = MM_mydb_STRING
Rs1.Source = "SELECT * FROM aa, bb WHERE a_id = b_aid"
Rs1.CursorType = 0
Rs1.CursorLocation = 2
Rs1.LockType = 1
Rs1.Open()
Rs1_numRows = 0
%>
<%
Dim Rs2
Dim Rs2_numRows
Set Rs2 = Server.CreateObject("ADODB.Recordset")
Rs2.ActiveConnection = MM_mydb_STRING
Rs2.Source = "SELECT a_aa, a_id FROM aa"
Rs2.CursorType = 0
Rs2.CursorLocation = 2
Rs2.LockType = 1
Rs2.Open()
Rs2_numRows = 0
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<%
While NOT Rs2.EOF
%>
<%=( "<font color=#FF0000>" & Rs2.Fields.Item("a_aa").Value & "</font></body><BR>")%>
<%
Rs2.MoveNext()
%>
<%
While NOT Rs1.EOF
%>
<%=(Rs1.Fields.Item("b_bb").Value)%>
<%
Rs1.MoveNext()
Wend
%>
<%
Wend
%>
</html>
<%
Rs1.Close()
Set Rs1 = Nothing
%>
<%
Rs2.Close()
Set Rs2 = Nothing
%>