ASP Unlimited Rating (recursive call) _ Application techniques

Source: Internet
Author: User
database field: ID (AutoNumber), class_name (menu name), ParentID (parent menu ID)
Copy Code code as follows:

<%
Dim m
M=0
Call Showtree (0)%>
<%
Sub Showtree (ParentID)
Dim s
M=m+1
Dim RS
Set rs = Server.CreateObject ("ADODB.") RecordSet ")
Sql= "Select class_id,class_name from [Wms_class] where class_father_id=" &cint (ParentID)
Rs.Open sql,conn,1,1
If rs.eof and M = 1 Then
Response. Write ("No column on this channel")
End If
Do but not Rs. Eof
Response. Write RS (0)
For N=1 to M
If n = m and M = 1 Then
Response.Write ("╋")
ElseIf n = 1 Then
Response.Write ("")
ElseIf n = m Then
Response.Write ("├")
Else
Response.Write ("│")
End If
Next
Response. Write RS (1) & "<br>"
Call Showtree (RS (0))
M=m-1
Rs. Movenext
Loop
End Sub
%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.