快精灵印艺坊 您身边的文印专家
广州名片 深圳名片 会员卡 贵宾卡 印刷 设计教程
产品展示 在线订购 会员中心 产品模板 设计指南 在线编辑
 首页 名片设计   CorelDRAW   Illustrator   AuotoCAD   Painter   其他软件   Photoshop   Fireworks   Flash  

 » 彩色名片
 » PVC卡
 » 彩色磁性卡
 » 彩页/画册
 » 个性印务
 » 彩色不干胶
 » 明信片
   » 明信片
   » 彩色书签
   » 门挂
 » 其他产品与服务
   » 创业锦囊
   » 办公用品
     » 信封、信纸
     » 便签纸、斜面纸砖
     » 无碳复印纸
   » 海报
   » 大篇幅印刷
     » KT板
     » 海报
     » 横幅

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

创建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神秘面纱(3)
下一教程: ASP.NET高级教程(3):对象

您可以阅读与"使用索引服务器 - 创建ASP页面"相关的教程:
· 使用索引服务器 - 增加属性
· 使用索引服务器- 使用索引服务器的对象
· 利用索引服务和ASP建立面向整个网站搜索程序
· 个人经验:使用ASP尽量减少服务器端的工作量
· 使用XMLDOM在服务器端生成静态HTML页面
    微笑服务 优质保证 索取样品