- 热门文章:
- · 使用索引服务器- 使用索引服务器的对象
- · 已调试好的asp程序在VB中转换为组件的技巧
- · ASP.NET HTTP运行时组成详解(1)
- · 实现类似Windows资源管理器的DataGrid(2)
- · ASP.NET HTTP运行时组成详解(2)
- · ASP.NET HTTP运行时组成详解(3)
- · ASP.NET HTTP运行时组成详解(4)
- · ASP.NET HTTP运行时组成详解(5)
- · ASP.NET中使用TreeView控件(1)
- · ASP.NET中使用TreeView控件(3)
- · ASP.NET中使用TreeView控件(2)
- · ASP.NET中使用TreeView控件(4)
上一篇:使用索引服务器 - 增加属性 >>
使用索引服务器 - 创建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")
下一篇:使用索引服务器- 使用索引服务器的对象 >>
相关文章:
- · ASP.NET服务器控件发送脚本(1)
- · ASP.NET服务器控件发送脚本(2)
- · ASP.NET服务器控件发送脚本(3)
- · ASP.NET服务器控件发送脚本(4)
- · ASP.NET+XML打造网络硬盘(1)
- · ASP.NET+XML打造网络硬盘 (3)
- · ASP导出Excel数据的四种方法(2)
- · ASP.NET应用程序设计的10大技巧(1)
- · ASP.NET应用程序设计的10大技巧(2)
- · ASP.NET应用程序设计的10大技巧(4)
- · ASP.NET结合COM组件发送Email
- · ASP.NET中Cookie编程简明参考
- · 剖析ASP.NET2.0站点导航功能之建立导航(1)
- · 剖析ASP.NET2.0站点导航功能之建立导航(2)
- · ASP.NET入门随想之金庸群“粒”传(1)
- · ASP.NET入门随想之金庸群“粒”传(2)
- · ASP.NET Web Matrix开发工具简介(1)
- · ASP.NET中自定义DataGrid分页设置的实现
- · 从SQL Server数据库提取图片并显示在DataGrid(2)
- · 利用HtmlGenericControl类,动态改变Title文字
- · ASP.NET中DataGrid控件应用技巧简述(1)
- · ASP.Net+XML打造留言薄(1)
- · 关于生成目录树结构的类(2)
- · 用VS2005开发ASP.NET 2.0数据库程序(1)
- · 用VS2005开发ASP.NET 2.0数据库程序(2)
- · 抢先试用ASP.NET 2.0中的新型安全控件(1)
- · 抢先试用ASP.NET 2.0中的新型安全控件(2)
- · 抢先试用ASP.NET 2.0中的新型安全控件(3)
- · 抢先试用ASP.NET 2.0中的新型安全控件(4)
- · 抢先试用ASP.NET 2.0中的新型安全控件(5)
- · 利用WWF进行ASP.NET程序开发(1)
- · 利用WWF进行ASP.NET程序开发(2)
- · 利用WWF进行ASP.NET程序开发(3)
- · 用ASP实现开关IIS不重启电脑
- · 在ASP中优化数据库处理
- · 用InStr函数实现代码减肥
- · vbscript和javascript互相调用方法
- · ASP页面内VBScript和JScript的交互
