如图:
这种大分类下面显示小分类是怎么实现的.
请教!
[此贴子已经被作者于2006-10-31 11:02:48编辑过]
类似于以下的方法
我用的嵌套循环做了
不知道你数据库的字段都有什么
下边代码给你参考一下吧
你自己再总结一下,我只是粗略的写了下。。。
<%
dim conn
set conn = server.CreateObject("adodb.connection")
conn.open "provider = microsoft.jet.oledb.4.0; data source ="&server.MapPath("11.mdb")
%>
<body>
<%
dim rs,sql,rs1,sql1
set rs = server.CreateObject("adodb.recordset")
sql = "select * from tab1 order by id asc"
rs.open sql,conn,1,1
%>
<table width="500" height="130" border="1" cellpadding="0" cellspacing="1">
<tr>
<%
dim i
i = 0
do while not rs.eof
%>
<td>
<table>
<tr>
<td>
<%=rs("jobclass")%>
</td>
</tr>
<tr>
<td>
<%
set rs1 = server.CreateObject("adodb.recordset")
sql1 = "select * from tab2 where job_class ='"&rs("jobclass")&"' order by id asc"
rs1.open sql1,conn,1,1
do while not rs1.eof
response.Write(rs1("zhylist")&"|")
rs1.movenext
loop
%>
</td>
</tr>
</table>
</td>
<%
i = i + 1
if (i mod 2) = 0 then
response.Write ("</tr><tr>")
end if
rs.movenext
loop
%>
</tr>
</table>