Recommandation de grenouille grenouille: ASP implémente la sélection de la structure des arbres à partir du blog uniquement
Recommandation de la grenouille des mots clés: ASP implémente la structure des arbres
Source
<! -
------------ [Test] Script de génération de table ---------------------------------------------------------------------------------------------------------
ifexists (select * fromdbo.sysobjectSwhereid = object_id (n '[dbo]. [test]') andObjectProperty (id, n'isUserable ') = 1)
droptable [dbo]. [test]
ALLER
Créatiable [dbo]. [Test] (
[id] [int] identité (1,1) notnull,
[str_note] [nvarchar] (50) collatechinese_prc_ci_asnull,
[père_id] [int] null
) Sur [primaire]
ALLER
->
<! -
************************* Données de test ******************
[id] [str_note] [père_id]
[1] [Books informatiques] [0]
[2] [Développement logiciel] [1]
[3] [Réparation matérielle] [1]
[4] [ASP] [2]
[5] [PHP] [2]
[6] [JSP] [2]
[7] [html] [2]
[8] [Afficher la réparation] [3]
[9] [Réparation de la carte mère] [3]
[10] [Réparation de la carte graphique] [3]
[11] [bases VBS] [4]
[12] [Basics HTML] [4]
[13] [Basics ADO] [4]
[14] [Do déclaration] [11]
[15] [pour la déclaration] [11]
[16] [Énoncé de sélection] [11]
*********************************************************
->
<%
DIMSTRCONN, CONN, RS, SQL
strConn = "Driver = {sqlServer}; server = localHost; database = wawavote; uid = sa; pwd = sa;"
Dimi
i = 0
FunctionShowTree (parentid)
i = i + 1
Diminue
Setrs = server.createObject ("adodb.recordSet")
sql = "SelectId, str_note, père_id, (selectstr_notefromtestt2wheret2.id = t1.father_id) asparentNamefromtestt1wheret1.father_id =" & cint (parentid)
Rs.OpenSQL, StrConn, 1,1
Dowhilenotrs.eof
forj = 1toi
Réponse.write ("---")
suivant
Response.Write (RS (1) & "[" & rs (3) & "] <br>")
Showtreers (0)
i = i-1
Rs.MovEnext
Boucle
Rs.Close: setrs = rien
Finition de fin
Subshowtable (tableau)
Diminue
Setrs = server.createObject ("adodb.recordSet")
SQL = "SELECT * FROM" & TRIM (TABLE)
Rs.OpenSQL, StrConn, 1,1
Fori = 0tors.fields.count-1
Response.Write ("[" & Rs.fields (i) .name & "]")
suivant
Réponse.write ("<br>")
Dowhilenotrs.eof
Fori = 0tors.fields.count-1
Response.Write ("[" & Rs.fields (i) .Value & "]")
suivant
Réponse.write ("<br>")
Rs.MovEnext
Boucle
Rs.Close: setrs = rien