คำแนะนำของกบกบ: ASP ใช้การเลือกโครงสร้างต้นไม้จากบล็อก Onlytiancai
คำแนะนำกบคำหลัก: ASP ใช้โครงสร้างต้นไม้
แหล่งที่มา
-
-ภายนอก
Ifexists (เลือก*fromdbo.sysobjectswhereid = object_id (n '[dbo]. [ทดสอบ]') AndoBjectProperty (id, n'isusertable ') = 1)
Droptable [DBO]. [ทดสอบ]
ไป
CreateTable [DBO]. [ทดสอบ] (
[id] [int] ตัวตน (1,1) notnull
[str_note] [nvarchar] (50) collatechinese_prc_ci_asnull,
[father_id] [int] null
) บน [หลัก]
ไป
-
-
*********************** การทดสอบข้อมูล ***************************
[id] [str_note] [father_id]
[1] [หนังสือคอมพิวเตอร์] [0]
[2] [การพัฒนาซอฟต์แวร์] [1]
[3] [ซ่อมฮาร์ดแวร์] [1]
[4] [ASP] [2]
[5] [PHP] [2]
[6] [JSP] [2]
[7] [HTML] [2]
[8] [การซ่อมแซมจอแสดงผล] [3]
[9] [การซ่อมแซมเมนบอร์ด] [3]
[10] [การซ่อมแซมการ์ดกราฟิก] [3]
[11] [พื้นฐาน VBS] [4]
[12] [พื้นฐาน HTML] [4]
[13] [พื้นฐาน ADO] [4]
[14] [คำสั่งทำ] [11]
[15] [สำหรับคำสั่ง] [11]
[16] [เลือกคำสั่ง] [11]
-
-
-
Dimstrconn, Conn, RS, SQL
strConn = "driver = {sqlserver}; เซิร์ฟเวอร์ = localhost; ฐานข้อมูล = wawavote; uid = sa; pwd = sa;"
Dimi
i = 0
FunctionShowTree (ParentID)
i = i+1
หรี่แสง
setRs = server.createObject ("adodb.recordset"))
sql = "selectId, str_note, father_id, (selectstr_notefromtestt2wheret2.id = t1.father_id) asparentnamefromtestt1wheret1.father_id =" & cint (parentid)
Rs.opensql, strconn, 1,1
dowhilenotrs.eof
forj = 1toi
Response.write ("---")
ต่อไป
Response.write (RS (1) & "[" & rs (3) & "] <br>")
Showtreers (0)
i = i-1
Rs.Movenext
วง
Rs.Close: setRs = ไม่มีอะไร
endfunction
subshowtable (ตาราง)
หรี่แสง
setRs = server.createObject ("adodb.recordset"))
sql = "เลือก*จาก" & trim (ตาราง)
Rs.opensql, strconn, 1,1
fori = 0tors.fields.count-1
Response.write ("[" & rs.fields (i) .name & "]")
ต่อไป
Response.write ("<br>")
dowhilenotrs.eof
fori = 0tors.fields.count-1
Response.write ("[" & Rs.Fields (i) .Value & "]")
ต่อไป
Response.write ("<br>")
Rs.Movenext
วง
Rs.Close: setRs = ไม่มีอะไร