关键代码:
<% set conn=server.createobject("ADODB.CONNECTION") connstr="DBQ="+server.mappath("db1.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" conn.open connstr function menu(id) set rs=server.CreateObject("adodb.recordset") sql="select * from menu where id1="&id&" order by url,id" rs.open sql,conn,1,1 if rs.recordcount=0 then rs.close set rs=nothing exit function end if response.write(" ") i=1 while not rs.eof if len(rs("url"))>0 then if i=rs.recordcount then menutype="file1" else menutype="file" end if menuname=""&rs("menuname")&"" onmouseup="" else if i=rs.recordcount then menutype="menu3" listtype="list1" onmouseup="with(eval('id"&rs("id")&"'))if(style.display==''){style.display='none';this.className='menu3';}else{style.display='';this.className='menu4';}" else menutype="menu1" listtype="list" onmouseup="with(eval('id"&rs("id")&"'))if(style.display==''){style.display='none';this.className='menu1';}else{style.display='';this.className='menu2';}" end if menuname=rs("menuname") end if %> |
<%if len(rs("url"))<3 then%> " style="display:none"> <%menu(rs("id"))%> | <% end if rs.movenext i=i+1 wend response.write(" ") rs.close set rs=nothing end function %>
http://www.domain.com/" target="_blank">http://www.domain.com/提供最新下载《管理》
<% menu 0 conn.close set conn=nothing %>
|