|
现有表1和表2,表中存放的是大类的名字,表2中存放的是大类及相应的小类的名字,要根据表1的大类的名字从表2中读取相应的小类的名字,可总是进入死循环,代码如下:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
set rs_qiyebc=server.createobject("adodb.recordset")
sqlqiyebc="select * from BigClass_down"
rs_qiyebc.open sqlqiyebc,conn,1,1
bcx=4
%>
<%do while not rs_qiyebc.eof%>
<tr>
<td><%=cutstr(rs_qiyebc("BigClassName"),11)%></td>
</tr>
<%
BigClassName=rs_qiyebc("BigClassName")
rs_qiyebc.movenext
if x=4 then exit do
loop
%>
<%
set rs_qiye3=server.createobject("adodb.recordset")
sqlqiye3="select * from SmallClass_down where BigClassName=" & BigClassName & ""
rs_qiye3.open sqlqiye3,conn,1,1
x3=0
%>
<%do while not rs_qiye3.eof%>
<tr>
<td><%=cutstr(rs_qiye3("SmallClassName"),11)%></td>
</tr>
<%
rs_qiye3.movenext
x3=x3+1
if x3=4 then exit do
loop
%>
</table>
请问那里有错啊 |
|