无线扩展器和中继器:ASP搜索引擎问题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 04:41:53
偶想用写ASP搜索引擎,数据文件是.MDB格式的.数据库名字是#DB1.ASP
数据库里有几张表,偶想调用news表.表里有几个小表,有id(定义为编号)、title(文章具体标题)、content(文章具体内容)、time(发布文章的时间)、叙述完毕。(表单填写和查询结果分别在两个页面,查询结果页面在/kejibu/xushi/chaozhao.asp,表单填写页面在index.asp。)
偶想做个搜索引擎,搜索引擎包含几种搜索功能,其中包括按时间搜索、按具体内容搜索、按标题搜索、按点击次数搜索。
俺已经发好几条信息了,希望有能力的大哥给俺详细说说,或者将具体的代码告诉俺。别只说一章半节的。

打开数据库和输出分别该怎么写?下面是我写的输出页面:

<!--#include file = admin_conn.asp -->
<%
dim Key,KeyClass
Key=request.Form("Key")
KeyClass=request.Form("KeyClass")

If KeyClass=1 then
sql="select *from news where content like '%"&Key&"%'"
ElseIf Keyclass=2 then
sql="select *from news where time='"&Key&"'"
ElseIf Keyclass=3 then
sql="select *from news where title like '%"&Key&"%'"
ElseIf Keyclass=4 then
sql="select *from news where hit="&Key
End if
Response.Write 这该怎么写???

%>

建立对像 rs 对象该怎么建立???最后的输出该怎么写????

下面是我写的提交表单:
<form method="post" action="/kejibu/xushi/chaozhao.asp">
<p align="left"> <select size="1" name="time">
<option value="content">具体内容</option>
<option value="time">
按时间
</option>
<option value="title">按标题</option>
</select><input type="text" name="word" size="15"><input type="submit" value="搜索" name="B1"></p>
</form>

提交表单有错误吗???

把以下代码加到你的response.write 那。
rs.open sql,conn,1,1
Response.Write "<a href="显示具体内容的页.asp">"&rs("title")&"</a>"

当然如果结果不是一条的话,还必须用循环。
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "没找到"
else
do while not rs.eof
Response.Write "<a href="显示具体内容的页.asp">"&rs("title")&"</a><br>"
rs.movenext
loop