<% '使用方法 dim db_id,db_pid,db_text,db_table,select_name,select_value,dbpath db_id = "id" '主id db_pid = "pid" '父ID db_text = "name" '名 db_table = "Folder" '表名 select_name = "Folder" '下拉菜单名 select_value = trim(request("s_v")) '值 dbpath = "mdb.asp" '数据库名 set conn=Server.CreateObject("ADODB.Connection") conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=;Data Source="&Server.MapPath(dbpath) set rs=Server.CreateObject("ADODB.Recordset") %> /**************************************************** * 原作者: Fason(阿信)[蒲佛信] * http://fason.nease.net/ * pufoxin@hotmail.com * --------------------------------------------- * 数据库版修改:51windows(海娃) * http://www.51windows.Net ****************************************************/ var select_value = "<% = select_value %>" function TreeView(obj,target){ this.obj=obj; this.root=new node(0); this.nodes=[] this.currentNode=null; this.html="" this.config={ blank :'┣━', line :'┣━' } for(i in this.config){var tem=this.config[i];this.config[i]=new Image();this.config[i].txt=tem} } function node(id,pid,txt){ this.id=id this.pid=pid this.txt=txt this.indent="" this.open=false; this.lastNode=false; this.hasNode=false } TreeView.prototype.add=function(id,pid,txt){ var itemTxt=txt?txt:"New Item" this.nodes[this.nodes.length]=new node(id,pid,itemTxt) } TreeView.prototype.DrawTree=function(pNode){ var str="" for(var i=0;i"+nNode.indent+this.DrawLink(nid)+"" if(nNode.hasNode){ str+=this.DrawTree(nNode) } return str; } TreeView.prototype.DrawLine=function(nNode,tem){ for(var i=1;i a.add(<%=rs(db_id)%>,<%=rs(db_pid)%>,'<%=rs(db_text)%>');<% rs.MoveNext Wend rs.close Set rs=nothing conn.close Set conn=nothing %> document.write(""+a+"");