| ID | title | word | url |
| 1 | cgi教程 | 本地調試cgi | cgi/testcgi.htm |
| 2 | 下載中心 | 聊天室,留言本 | download/index.htm |
| <!–#INCLUDE file=”ADOVBS.inc”–> <% “建立數據庫的連接 con=”DBQ=”+server.mappath(“list.mdb”)+”;DefaultDir=;DIRVER={microsoft Access Driver(*.mdb)};” ”建立CONNECTION對象并打開數據庫 set mycon=server.createobject(“ADODB.CONNECTION”) mycon.open.con %> ”創建Recordset對象的例程,打開Recordset對象傳遞SQL串以及所有的連接信息 <% set rs=server.createobject(“ADODB.Recordset”) rs.open “SELECT*FORM list where title and word like ’%’&request.form(“word”)&”%'”,MyCon,adOpenStatie %> ”建立查詢后的顯示信息和查詢頁面,你想取什么名字都可以 <html><head><title>查詢結果</title></head> <body bgcolor=”#ffffff”> <p align=”center”><br> ”統計查詢共有<% Response.Write(RS.RecordCount) %>條紀錄</p><br> <P align=”center”><center> <table border=”1″ align=”center” bordercolor=”000000″ berdorcoorlight=”#000000″ bordercolordark=”#ffffff”> <tr align=”center”> <td width=”20%” align=”center” bgcolor=”#ffffff”>ID</td> <td width=”60%” align=”center” bgcolor=”#ffffff”>主題</td> <td width=”20%” align=”center” bgcolor=”#ffffff”>查看</td></table> <table border=”1″ align=”center” bordercolor=”000000″ berdorcoorlight=”#000000″ bordercolordark=”#ffffff”> <tr align=”center”> <!–從數據庫提取信息–> <% while not rs.eof %> <tr align=”center”> <td width=”20%” align=”center” bgcolor=”#ffffff”><% =rs(“id”) %></td> <td width=”60%” align=”center” bgcolor=”#ffffff”><% =rs(“title”) %></td> <td width=”20%” align=”center” bgcolor=”#ffffff”><a href=”<% =rs(“url”) %>”>GO</a></td> <% rs.movenext %></tr> <% wend %></table></center></P> <% rs.close %> <% mycon.close %> ”關閉鏈接 </body></html> |
| <html><head><title>搜索頁面</title></head> <!–創建搜索表格–> <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> |