日期:2014-05-17  浏览次数:20939 次

高分救助
问题如下:
数据库中有四个字段  
aa,bb,cc,dd
_     A     *     *
_     A     D     *
_     A     D     001
_     B     *     *
S     A     *     *


_     A     D     001是   _     A     D     *   的下级(*是通配符)
_     A     *     *   就是所有   aa   是_   并且bb是A的上级
求在asp中怎么树形显示这些数据记录.谢谢

------解决方案--------------------
<%
set rs=conn.execute( "select aa,bb,cc,dd from [表名] where bb= '* ' and cc= '* ' and dd= '* ' ")
if not rs.eof and not rs.bof then
do while not rs.eof

aa=rs( "aa ")
set rs1=conn.execute( "select bb,cc,dd from [表名] where aa= ' "&aa& " ' and cc= '* ' and dd= '* ' ")
if not rs1.eof and not rs1.bof then
do while not rs1.eof

bb=rs( "bb ")
set rs2=conn.execute( "select cc,dd from [表名] where aa= ' "&aa& " ' and bb= ' "&bb& " and dd= '* ' ")
if not rs2.eof and not rs2.bof then
do while not rs2.eof

cc=rs2( "cc ")
set rs3=conn.execute( "select dd from [表名] where aa= ' "&aa& " ' and bb= ' "&bb& " and cc= ' "&cc& " ' ")
if not rs3.eof and not rs3.bof then
do while not rs3.eof
dd=rs3( "dd ")
rs3.move.next
loop
end if

rs2.move.next
loop
end if

rs1.move.next
loop
end if

rs.move.next
loop
end if
%>

没测试过,不知道这样是否能循环出来...
------解决方案--------------------
UP
------解决方案--------------------
UP
------解决方案--------------------
听听明白楼主的意思
------解决方案--------------------
是四级分类吗?
------解决方案--------------------
头晕,不明白