一个方法是利用Index Server query object和参数:
%
Set Q= Sever.CreatObject("ixsso.Query")
' 创建查询对象.
Set Util= Sever.CreatObject("ixsso.Util")
Q.Query= Request("SearchString")
' 查询字段.
Q.SortBy="rank[d] "
' 按照符合程度降序排列
Q.Columns="Doctitle,vpath,filename,size,write,characterization,rank"
' 返回记录属性.
Q.MaxRecords=300
' 最多返回记录数.
Util.AddScopeToQuery Q, "/","DEEP"
' 搜索所有子目录.
Q.LocaleID=Util.ISOToLocaleID(“ZH-CN”)
' 指定所用语言为简体中文.
Set RS = Q.CreateRecordSet("nonsequential")
' 创建输出集.
%>
另一个方法就是.利用ADO query object和SQL语句:
%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "provider=msidxs;"
Conn.Open
Set AdoCommand = Server.CreateObject("ADODB.Command")
Set AdoCommand.ActiveConnection = Conn
AdoCommand.CommandText = "Select Doctitle,vpath,filename,size,write, ""characterization,rank from SCOPE() WHERE CONTAINS (` "SearchString "`) ORDER BY rank DESC"
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.open AdoCommand
%>
您可能感兴趣的文章:- ASP编程入门进阶(七):内置对象Server
- asp sqlserver 执行存储过程返回记录集报对象关闭时不允许操作
- asp提示Server 对象 错误 ASP 0178 : 80070005
- Asp.net内置对象之Server对象(概述及应用)
- ASP基础入门第十篇(ASP内建对象Server)