网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.将ASP纪录集输出成n列的的表格形.
.NT 下虚拟域名的实现.
.用存储过程实现ASP对数据库访问.
.asp模仿 Lotus Notes 的界面程序.
.如何用ASP编写网站统计系统二.
.如何设置二级域名?.
.关于打印页面的一些经验.
.透彻掌握ASP分页技术.
.remote script文档(转载自微软)(.
.为ASP开发者介绍ColdFusion.
.用RecordSet实现分页(by Daniel .
.生成像资源管理器一样的树形目录.
.加快DHTML的一组技巧.
.如何增强ASP程序性能(2).
.通过asp入侵web server,窃取文件.
.Asp base64编码、解码函数.
.巧用ISAPI_Rewrite规则写IIS防盗.
.利用XML不离开页面刷新数据.
.批量判断域名是否被注册程序代码.
.正则表达式 大杂烩.

使用索引服务器 - 创建ASP页面

发表日期:2001-1-27


创建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")   
作者/出处:青苹果工作室
上一篇:使用索引服务器- 使用索引服务器的对象 人气:9587
下一篇:使用索引服务器 - 增加属性 人气:9760
浏览全部的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐