asp 大类出来 小类出不来!!!

居思安VIP 2009-09-19 06:08:19
sub ShowSmallClass_Tree()
if rsBigClass.bof and rsBigClass.eof then
response.Write "栏目正在建设中……"
else
dim sqlClass,rsClass,strTree,BigClassNum,i,j
rsBigClass.movefirst
BigClassNum=rsBigClass.recordcount
i=1
do while not rsBigClass.eof
if i<BigClassNum then
strTree=""
else
strTree=""
end if
sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
strTree= strTree & "<table width=230 border=0 cellpadding=0 cellspacing=0>"
strTree= strTree & "<tr>"
strTree= strTree & "<td width=30 height=22>"
strTree= strTree & "<div align=right><img src=Img/arrow_6.gif width=13 height=11></div></td>"
strTree= strTree & "<td width=200>"
strTree= strTree & "<a href='Product.asp?BigClassName="&rsBigClass("BigClassName") & "'>"
strTree= strTree &"  "& rsBigClass("BigClassName")
strTree=strTree & "</a></td>"
'strTree=strTree & "</td>"

strTree= strTree & "</tr><tr id=child<%=sqlBigClass%> style='display:none'>"
strTree=strTree & "<td height=1 colspan=2 >"
'显示小类名称
sqlSmallClassName = "select * from SmallClass where BigClassName=(select BigClassName from BigClass where BigClassName='" & reBigClass("BigClassName") &"') Order by SmallClassID"
set rsmClass = Server.CreateObject("ADODB.Recordset")
rsmClass.open sqlSmallClassName,1,1
j=1
strTree=strTree & "<div style=padding-left:12px;padding-top:0px;line-height:18px>"
strTree=strTree & "<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") &"SmallClassName=" & rsSmallClass("SmallClassName") & rsSmallClass("SmallClassName")&'></a>"
strTree=strTree & "</div>"

strTree=strTree & "<img height=1 src=img/1x1_pix.gif width=10/></td>"
strTree=strTree & "</tr>"
strTree=strTree & "</table>"
SmallClassNum=rsClass.recordcount
j=1
do while not rsClass.eof
rsClass.movenext
j=j+1
loop
response.write strTree
rsBigClass.movenext
i=i+1
'if i>100 then exit do
rsmClass.eof
rsSmallClass.movenext
j=j+1
loop
rsClass.close
set rsClass=nothing
end if
end sub


可以把大类读取出来 小类读取不出来!!!
...全文
33 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2009-09-19
  • 打赏
  • 举报
回复
sqlSmallClassName = "select * from SmallClass where BigClassName IN (select BigClassName from BigClass where BigClassName='" & reBigClass("BigClassName") &"') Order by SmallClassID"

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧