| ID | title | word | url |
| 1 | cgi教程 | 本地調(diào)試cgi | cgi/testcgi.htm |
| 2 | 下載中心 | 聊天室,留言本 | download/index.htm |
| <!–#INCLUDE file=”ADOVBS.inc”–> <% “建立數(shù)據(jù)庫(kù)的連接 con=”DBQ=”+server.mappath(“list.mdb”)+”;DefaultDir=;DIRVER={microsoft Access Driver(*.mdb)};” ”建立CONNECTION對(duì)象并打開數(shù)據(jù)庫(kù) set mycon=server.createobject(“ADODB.CONNECTION”) mycon.open.con %> ”創(chuàng)建Recordset對(duì)象的例程,打開Recordset對(duì)象傳遞SQL串以及所有的連接信息 ?。? set rs=server.createobject(“ADODB.Recordset”) rs.open “SELECT*FORM list where title and word like ’%’&request.form(“word”)&”%'”,MyCon,adOpenStatie %> ”建立查詢后的顯示信息和查詢頁(yè)面,你想取什么名字都可以 ?。糷tml><head><title>查詢結(jié)果</title></head> ?。糱ody bgcolor=”#ffffff”> ?。紁 align=”center”><br> ”統(tǒng)計(jì)查詢共有<% Response.Write(RS.RecordCount) %>條紀(jì)錄</p><br> <P align=”center”><center> <table border=”1″ align=”center” bordercolor=”000000″ berdorcoorlight=”#000000″ bordercolordark=”#ffffff”> ?。紅r align=”center”> <td width=”20%” align=”center” bgcolor=”#ffffff”>ID</td> ?。紅d width=”60%” align=”center” bgcolor=”#ffffff”>主題</td> ?。紅d width=”20%” align=”center” bgcolor=”#ffffff”>查看</td></table> ?。紅able border=”1″ align=”center” bordercolor=”000000″ berdorcoorlight=”#000000″ bordercolordark=”#ffffff”> ?。紅r align=”center”> ?。?–從數(shù)據(jù)庫(kù)提取信息–> <% while not rs.eof %> ?。紅r align=”center”> ?。紅d width=”20%” align=”center” bgcolor=”#ffffff”><%%20=rs(“id”) %></td> ?。紅d width=”60%” align=”center” bgcolor=”#ffffff”><%%20=rs(“title”) %></td> ?。紅d width=”20%” align=”center” bgcolor=”#ffffff”><a href=”<%%20=rs(“url”) %>”>GO</a></td> ?。? rs.movenext %></tr> <% wend %></table></center></P> ?。? rs.close %> <% mycon.close %> ”關(guān)閉鏈接 ?。?body></html> |
| <html><head><title>搜索頁(yè)面</title></head> <!–創(chuàng)建搜索表格–> <from method=”POST” action=”search.asp”> <P align=”center”><center><p><input type=”text” name=”word” size=”30″> <input type=”submit” value=”提交” name=”B1″><input type=”reset” value=”清除” name=”B2″></p> </center></P></form> <hr width=”600″ align=”center”> <html> |