创建ASP页面
在ASP页面上一切都变得非常酷。你用表单中的值来驱动对索引服务器进行查询的对象。
整个过程是这样的:
◆ 打开记录集。
◆ 用标准ADO 方法,一步步地走过记录集。
<%
"Create a Query object, initialize it using
"SetQueryFromURL, and dump the object state
"set the query object
Set objQuery = Server.CreateObject("ixsso.Query")
"get the query properties set from the
"incoming URL (from the form GET operation)
objQuery.SetQueryFromURL(Request.QueryString)
"tell the object what columns to include
objquery.columns="filename,HitCount,vpath,DocTitle,characterization"
"open the recordset, causing the query to be
"executed
set rsQuery = objquery.createrecordset("nonsequential")
"now, if rsquery.eof is not TRUE, then we have results
"to show. If it IS TRUE, no results were found.
"get the page out for the user...
%>
<html>
<head>
</head>
<h1>Search Results</h1>
A maximum of 200 results will be returned, 20 hits per page will be shown. <br><br>
<%
if not rsquery.eof then
Response.Write rsquery.recordcount & " hit(s) were found. "
if rsquery.recordcount > 30 then
Response.Write "You may want to refine your query."
end if
Response.Write "<br>"
end if
%>
<%
if not rsquery.eof then
while not rsquery.eof and rowcount > 0
if rsquery("doctitle") <> "" then
Response.Write "<p><b><a href="" & rsquery("vpath") & "">" & rsquery("doctitle") & "</a></b><br>"
response.write "<font size=-1>" & rsquery("characterization") & "...</font><Br>"
Response.Write "<font size=- 2>" & rsquery("hitcount") & " hit(s)</font></p>"
end if
rowcount = rowcount - 1
rsquery.movenext
wend
Response.Write "<br><Br>"
%>
<%
else
%>
<p>
对不起,没有发现纪录,如果要查询两个以上的词,使用and或or。
</p>
<%
end if
%>
</body>
</html>
你需要做的第一件事就是建立对索引服务器对象的引用。这是通过使用server.creatobject方法来完成的:
Set objQuery = Server.CreateObject("ixsso.Query")
作者/出处:青苹果工作室专题:http://www.qqread.com/asp/u962452001.html
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- FTP服务器 (5903篇文章)
- 双核服务器技术 (6830篇文章)
- 网站服务器的选型 (8249篇文章)
- 网吧流媒体服务器 (6297篇文章)
- 刀片服务器专题 (5455篇文章)
- 网吧服务器专栏 (5430篇文章)
- 服务器配置专栏 (10894篇文章)
- IIS服务器应用技巧 (6017篇文章)
- 打造安全服务器 (13194篇文章)
- SQL Server 索引和查询专题 (3320篇文章)
- ASP连接十一种数据库的常用语法 (47次浏览)
- ASP连接数据库错误解决办法新法 (32次浏览)
- Asp常见问题(新手) (0次浏览)
- asp编译成dll-图形化教程 (0次浏览)
- ASP编程入门进阶 (0次浏览)
- Asp备份与恢复SQL Server数据库 (0次浏览)
- Asp+的几个特点 (0次浏览)
- ASP:在结果中搜索 (0次浏览)
- asp 中对 ip 进行过滤限制函数 (0次浏览)
- ASP 指南 (0次浏览)



