E库技术学院--您的网络技术顾问! 网站首页素材图片库设计原稿网页模板网站赏析下载中心明星图库E库论坛  
E库技术学院
设为首页
加入收藏
我要投稿
E库首页学院首页 ┊ 图形图象 ┊ 网页设计 ┊ 网络编程 ┊ 数据库 ┊ 服务器 ┊ 建站技术 ┊ 业界新闻 ┊ 作者专栏 ┊ 常用范文 ┊ 预留栏目
  当前位置:学院首页>>网络编程教程>>ASP编程教程>>使用索引服务器 - 创建ASP页面
使用索引服务器 - 创建ASP页面
[ 来源: | 作者: | 时间:2006-4-27 21:54:57 | 浏览:人次 ]
收藏到新浪ViVi收藏到365KEY收藏到我摘 ┊ 双击滚屏 单击停止
    创建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页面”教程到此结束==>||
 相关教程
使用索引服务器 - 创建ASP页面
特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。

投稿作者:  信息来源:  录入时间: 2006-4-27 21:54:57
投稿信箱: web#iecool.com
设为首页 - 加入收藏 - 关于我们 - 广告服务 - 版权申明 - 友情链接 - 联系方式 - 会员投稿
E库技术学院 © 2004-2005 Edu.IEcool.Com  浙ICP备05015070号