Author |
Message |
ghdhair100
Forum Master
Joined: 15 Dec 2010
Posts: 1972
Read: 0 topics
Location: England
|
|
递归实现tree |
|
dim myrs
dim lev
lev=0
str="+"
sqlstr="select id,dept_name,lev from cpb_dept where len(lev)=len("& uplev &")+1 and left(lev,len("&uplev&"))="& uplev & " and dept_name not like '%测试%' and flag=true order by lev "
set rs=server.createobject("adodb.recordset")
rs.open sqlstr,conn,1,3
If rs.RecordCount > 0 Then
myrs=rs.GetRows()
rs.Close
Set rs = Nothing
recN=UBound(myrs,[link widoczny dla zalogowanych],2)
For i=0 To recN
if len(myrs(2,i))<>lev then
lev=len(myrs(2,i))
for ii=0 to lev
str=str & "--"
next
end if
'Response.Write("ID: "&myrs(0,i)&", First: "&myrs(1,[link widoczny dla zalogowanych],i)&", Second: "&myrs(2,i)&"<br />")
Response.Write(str & "<img str=images/nofollow.gif>"& myrs(1,i)&"<br />")
call tree(myrs(2,[link widoczny dla zalogowanych],i))
Next
else
rs.Close
Set rs = Nothing
Exit sub
end if
end sub
call tree("11")
sub tree(UPlev)
Many years ago there lived an Emperor who was so exceedingly fond of fine new clothes that he spent vast sums of money on dress. To him clothes meant more than anything else in the world. He took no interes
related links:
[link widoczny dla zalogowanych]
The post has been approved 0 times
|
|
Wed 4:35, 09 Mar 2011 |
|
|
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|