谁能帮忙解决全文检索的问题?

runqi 2001-07-12 05:40:26
我把index server已配置好且已运行,但在asp中写的
<%set objquery=server.CreateObject ("ixsso.query")%>语句运行时,
报出:

Microsoft VBScript 编译器错误 (0x800A0408)
无效字符
  set objquery=server.CreateObject ("ixsso.query")

的信息.我不知什么原因,请教各位高手!
我的环境是WINDOWS XP,IIS6.0
...全文
70 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
dotnba 2001-07-12
<html>
<head>

<script LANGUAGE="VBScript" RUNAT="Server">
<!--
option explicit
-->
</script>
<title>Advanced Index Server Search Form</title>
<link REL="STYLESHEET" HREF="is2style.css" TYPE="text/css">
<meta NAME="DESCRIPTION" CONTENT="Sample query form for Microsoft Index Server">
<meta NAME="AUTHOR" CONTENT="Index Server Team">
<meta NAME="KEYWORDS" CONTENT="query, content, hit">
<meta NAME="SUBJECT" CONTENT="sample form">
<meta NAME="MS.CATEGORY" CONTENT="Internet">
<meta NAME="MS.LOCALE" CONTENT="ZH-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=GB2312">
<%
DebugFlag = FALSE
NewQuery = FALSE
UseSavedQuery = FALSE
SearchString = ""
Scope="/"
Doctype=""
QueryForm = Request.ServerVariables("PATH_INFO")

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
SearchString = Request.Form("SearchString")
DocAuthorRestriction = Request.Form("DocAuthorRestriction")
FSRest = Request.Form("FSRest")
FSRestVal = Request.Form("FSRestVal")
FSRestOther = Request.Form("FSRestOther")
FMMod = Request.Form("FMMod")
FMModDate = Request.Form("FMModDate")
SortBy = Request.Form("SortBy")
Colset = Request.Form("ColChoice")
Doctype = Request.Form("Doctype")
Scope = Request.Form("Scope")
RankBase = Request.Form("RankBase")
' NOTE: this will be true only if the button is actually pushed.
if Request.Form("Action") = "执行" then
NewQuery = TRUE
elseif Request.Form("pg") <> "" then
UseSavedQuery=TRUE
NextPageNumber = Request.Form("pg")
end if
end if
%>
<style>
.fontstyle{font-size:9pt}
</style>

</head>

<body topmargin="0" leftmargin="0" background="is2bkgnd.gif" OnLoad="SetAll()" LANGUAGE="JavaScript">

<table>
<tr><td><a HREF="http://web_server" target="_top"><img SRC="title.gif" border="0" VALIGN="MIDDLE" ALIGN="LEFT" WIDTH="227" HEIGHT="80"></a></td></tr>
<tr><td ALIGN="RIGHT"><h3>TQNPC全文检索</h3></td></tr>
</table>
<hr>
<script LANGUAGE="JavaScript">
<!--
function SetAll()
{
document.QForm.SearchString.value = "<%=SearchString%>";
document.QForm.Scope.value = "<%=Scope%>";
document.QForm.Doctype.value = "<%=Doctype%>";

<%select case FSRest%>
<%case " > "%>
document.QForm.FSRest.selectedIndex = 1;
<%case else%>
document.QForm.FSRest.selectedIndex = 0;
<%end select%>

<%select case FSRestVal%>
<%case "any"%>
document.QForm.FSRestVal.selectedIndex = 0;
<%case "100"%>
document.QForm.FSRestVal.selectedIndex = 1;
<%case "1024"%>
document.QForm.FSRestVal.selectedIndex = 2;
<%case "10240"%>
document.QForm.FSRestVal.selectedIndex = 3;
<%case "102400"%>
document.QForm.FSRestVal.selectedIndex = 4;
<%case "1048576"%>
document.QForm.FSRestVal.selectedIndex = 5;
<%case "10485760"%>
document.QForm.FSRestVal.selectedIndex = 6;
<%case "104857600"%>
document.QForm.FSRestVal.selectedIndex = 7;
<%case "other"%>
document.QForm.FSRestVal.selectedIndex = 8;
<%case else%>
document.QForm.FSRestVal.selectedIndex = 0;
<%end select%>

document.QForm.FSRestOther.value = "<%=FSRestOther%>";

<%select case FMMod%>
<%case "any"%>
document.QForm.FMMod.selectedIndex = 0;
<%case "-10n"%>
document.QForm.FMMod.selectedIndex = 1;
<%case "-1h"%>
document.QForm.FMMod.selectedIndex = 2;
<%case "-1d"%>
document.QForm.FMMod.selectedIndex = 3;
<%case "-1w"%>
document.QForm.FMMod.selectedIndex = 4;
<%case "-1m"%>
document.QForm.FMMod.selectedIndex = 5;
<%case "-1y"%>
document.QForm.FMMod.selectedIndex = 6;
<%case "since"%>
document.QForm.FMMod.selectedIndex = 7;
<%case else%>
document.QForm.FMMod.selectedIndex = 0;
<%end select%>

document.QForm.FMModDate.value = "<%=FMModDate%>";

document.QForm.DocAuthorRestriction.value = "<%=DocAuthorRestriction%>";
}
//-->
</script>

<center>
<form NAME="QForm" ACTION="<%=QueryForm%>" METHOD="POST">
<table width="500" style="font-size:9pt">

<tr>
<td align="right" colspan="2">输入查询条件:
<input class="fontstyle" TYPE="TEXT" NAME="SearchString" SIZE="27" MAXLENGTH="100" VALUE></td>
</tr>

<tr>
<td align="right" colspan="2">文档作者:
<input class="fontstyle" TYPE="TEXT" NAME="DocAuthorRestriction" SIZE="27" MAXLENGTH="100" VALUE>
<td>
</tr>

<tr>
<td align="right" colspan="2">文件类型:
<select NAME="Doctype" class="fontstyle">
<option VALUE="" SELECTED>所有文件
<option VALUE=".doc">Word文件
<option VALUE=".xls">Excel文件
<option VALUE=".ppt">幻灯片
<option VALUE=".txt">文本文件
<option VALUE=".jpg">图片
<option VALUE=".pdf">PDF文件
</select>
<td>
</tr>


<tr>
<td align="right" colspan="2">选择部门:
<select class="fontstyle" NAME="Scope">
<option VALUE="/" SELECTED>所有部门
<option VALUE="/tqnpc/公司办">公司办公室
<option VALUE="/tqnpc/工程计划处">工程计划处
<option VALUE="/tqnpc/工程管理处">工程管理处
<option VALUE="/tqnpc/质量保证处">质量保证处
<option VALUE="/tqnpc/合同处">合同管理处
<option VALUE="/tqnpc/设计管理处">设计管理处
<option VALUE="/tqnpc/设备管理处">设备管理处
<option VALUE="/tqnpc/文件档案处">文件档案处
<option VALUE="/tqnpc/财务处">财务处
<option VALUE="/tqnpc/审计处">审计处
<option VALUE="/tqnpc/劳动人事处">劳动人事处
<option VALUE="/tqnpc/政工处">政工处
<option VALUE="/tqnpc/枫叶村办公室">枫叶村办公室
<option VALUE="/tqnpc/调试.生产处">调试、生产准备处
</select>

<td>
</tr>

<tr>
<td align="right" colspan="2">文件大小: <select class="fontstyle" NAME="FSRest">
<!-- <OPTION VALUE=" < " <%if FSRest = " < " then%>SELECTED <%end if%>>Less Than <OPTION VALUE=" > " <%if FSRest = " > " then%>SELECTED <%end if%>>大于 -->
<option VALUE=" < " SELECTED>小于
<option VALUE=" > ">大于
</select>

<select class="fontstyle" NAME="FSRestVal">
<option VALUE="any" SELECTED>任意大小
<option VALUE="100">100 字节
<option VALUE="1024">1K 字节
<option VALUE="10240">10K 字节
<option VALUE="102400">100K 字节
<option VALUE="1048576">1M 字节
<option VALUE="10485760">10M 字节
<option VALUE="104857600">100M 字节
<option VALUE="other">其他
</select>

<input class="fontstyle" TYPE="TEXT" NAME="FSRestOther" SIZE="12" MAXLENGTH="9" VALUE>
</td>
</tr>

<tr>
<td align="right" colspan="2">修改时间:
<select class="fontstyle" NAME="FMMod">
<option VALUE="any" SELECTED>任意时间。
<option VALUE="-10n">最近十分钟内。
<option VALUE="-1h">最近一小时内。
<option VALUE="-1d">最近一天内。
<option VALUE="-1w">最近一周内。
<option VALUE="-1m">最近一月内。
<option VALUE="-1y">最近一年内。
<option VALUE="since">从 GMT (yy/mm/dd) 以后。
</select>
<input class="fontstyle" TYPE="TEXT" NAME="FMModDate" SIZE="12" MAXLENGTH="9" VALUE>
</td>
</tr>

<tr>
<td align="right" colspan="2"><a HREF="ixtiphlp.htm">搜索提示</a>
<input class="fontstyle" TYPE="SUBMIT" NAME="Action" VALUE="执行">
<input class="fontstyle" TYPE="RESET" NAME="Clear" VALUE="清除">
</td>
</tr>
</table>

<input TYPE="HIDDEN" NAME="SortBy" VALUE="rank[d]">
<input TYPE="HIDDEN" NAME="ColChoice" VALUE="1">
<!-- <input TYPE="HIDDEN" NAME="Scope" VALUE="/tqnpc/文件档案处">-->

</form>
<br>

<%if DebugFlag then%>
<pre>
SearchString = <%=SearchString%>
DocAuthorRestriction = <%=DocAuthorRestriction%>
FSRest = <%=FSRest%>
FSRestVal = <%=FSRestVal%>
FSRestOther = <%=FSRestOther%>
FMMod = <%=FMMod%>
FMModDate = <%=FMModDate%>
SortBy = <%=SortBy%>
Colset = <%=Colset%>
Scope = <%=Scope%>
NewQuery = <%=CStr(NewQuery)%>
UseSavedQuery = <%=CStr(UseSavedQuery)%>
</pre>
<%end if%>

<%
if NewQuery then
set Session("Query") = nothing
set Session("Recordset") = nothing
NextRecordNumber = 1
set Q = Server.CreateObject("ixsso.Query")

Composer = ""
TheQuery = ""

if SearchString <> "" then
if Left( SearchSting, 1 ) <> "@" AND Left( SearchString, 1 ) <> "#" AND Left( SearchString, 1 ) <> "$" then
TheQuery = "(@Contents " + SearchString + ") "
else
TheQuery = "(" + SearchString + ") "
end if

Composer = " & "
end if

if FSRestVal <> "any" then
if FSRestVal <> "other" then
TheQuery = "(@Size " + FSRest + FSRestVal + ") " + Composer + TheQuery
else
TheQuery = "(@Size " + FSRest + FSRestOther + ") " + Composer + TheQuery
end if

Composer = " & "
end if

if Doctype <> "" then
TheQuery = "(@filename " + Doctype + ") " + Composer + TheQuery

Composer = " & "
end if

if DocAuthorRestriction <> "" then
TheQuery = "(@DocAuthor " + DocAuthorRestriction + ") " + Composer + TheQuery

Composer = " & "
end if

if FMMod <> "" AND FMMod <> "any" then
if FMMod <> "since" then
TheQuery = "(@Write > " + FMMod + ") " + Composer + TheQuery
else
TheQuery = "(@Write > " + FMModDate + ") " + Composer + TheQuery
end if
end if

Composer = " & "
if TheQuery="" then TheQuery="(@Size > 0)" end if

%> <%if DebugFlag then%> TheQuery = <%=TheQuery%> <%end if%> <%

Q.Query = TheQuery

Q.SortBy = SortBy
if Scope <> "/" then
set Util = Server.CreateObject("ixsso.Util")
Util.AddScopeToQuery Q, Scope, "DEEP"
set Util = nothing
end if
if ColSet = 1 then
Q.Columns = "DocTitle, vpath, path, filename, size, write, characterization, rank"
RecordsPerPage = 10
elseif ColSet = 2 then
Q.Columns = "vpath, path"
RecordsPerPage = 200
elseif ColSet = 3 then
Q.Columns = "filename, vpath, size, write"
RecordsPerPage = 25
end if

set RS = Q.CreateRecordSet("nonsequential")
RS.PageSize = RecordsPerPage
ActiveQuery = TRUE
elseif UseSavedQuery then
if IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) then
set Q = Session("Query")
set RS = Session("RecordSet")
if RS.RecordCount <> -1 and NextPageNumber <> -1 then
RS.AbsolutePage = NextPageNumber
NextRecordNumber = RS.AbsolutePosition
end if
ActiveQuery = TRUE
else
Response.Write "出错 - 未保存查询"
end if
end if

if ActiveQuery then
if not RS.EOF then
%>

<p>
<hr WIDTH="100%" ALIGN="center" SIZE="3">
<p>

<%
LastRecordOnPage = NextRecordNumber + RS.PageSize - 1
CurrentPage = RS.AbsolutePage
if RS.RecordCount <> -1 AND RS.RecordCount < LastRecordOnPage then
LastRecordOnPage = RS.RecordCount
end if

Response.Write "文档 " & NextRecordNumber & " 到 " & LastRecordOnPage
if RS.RecordCount <> -1 then
Response.Write "(共 " & RS.RecordCount & " )"
end if

if SearchString <> "" then
Response.Write "符合查询“<B>"
Response.Write SearchString & "</B>”。<P>"
end if
%>
</pre>

<table border="0">
<colgroup width="105">
<% Do While Not RS.EOF and NextRecordNumber <= LastRecordOnPage

' This is the detail portion for Title, Abstract, URL, Size, and
' Modification Date.
' If there is a title, display it, otherwise display the filename.
' Graphically indicate rank of document with list of stars (*'s).

if NextRecordNumber = 1 then
RankBase=RS("rank")

if RankBase>1000 then
RankBase=1000
elseif RankBase<1 then
RankBase=1
end if
end if

NormRank = RS("rank")/RankBase

if NormRank > 0.80 then
stars = "rankbtn5.gif"
elseif NormRank > 0.60 then
stars = "rankbtn4.gif"
elseif NormRank > 0.40 then
stars = "rankbtn3.gif"
elseif NormRank >.20 then
stars = "rankbtn2.gif"
else stars = "rankbtn1.gif"

end if

%>

<tr class="RecordTitle">
<td align="right" valign="top" class="RecordTitle">
<%= NextRecordNumber%>.
</td>
<td><b class="RecordTitle">
<%if VarType(RS("DocTitle")) = 1 or RS("DocTitle") = "" then%>
<a href="<%=RS("vpath")%>" class="RecordTitle"><%= Server.HTMLEncode( RS("filename") )%></a>
<%else%>
<a href="<%=RS("vpath")%>" class="RecordTitle"><%= Server.HTMLEncode(RS("DocTitle"))%></a>
<%end if%>
</b></td>
</tr>
<tr>
<td valign="top" align="left">
<img SRC="<%=stars%>">
<br>
<%
' Construct the URL for hit highlighting
WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( RS("vpath") )
WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( Q.Query )
WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "<b class=Hit>" )
WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "</b>" )
WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm
' WebHitsQuery = WebHitsQuery & "&CiLocale=" & Q.LocaleID
%>
<a href="oop/qsumrhit.htw?<%= WebHitsQuery %>"><img src="hilight.gif" align="left" alt="用摘要模式加亮显示文档中匹配的词条。" WIDTH="22" HEIGHT="22">摘要</a>
<br>
<a href="oop/qfullhit.htw?<%= WebHitsQuery %>&CiHiliteType=Full"><img src="hilight.gif" align="left" alt="加亮显示文档中匹配的词条。" WIDTH="22" HEIGHT="22">完全</a>
</td>
<td valign="top">
<%if VarType(RS("characterization")) = 8 and RS("characterization") <> "" then%>
<b><i>摘要:</i></b><%= Server.HTMLEncode(RS("characterization"))%>
<%end if%>
<p>
<i class="RecordStats"><a href="<%=RS("vpath")%>" class="RecordStats" style="color:blue;">http://<%=Request("server_name")%><%=RS("vpath")%></a>
<br><%if RS("size") = "" then%>(大小和时间未知)<%else%>大小 <%=RS("size")%> 字节 - <%=RS("write")%> GMT<%end if%></i>
</td>
</tr>
<tr></tr>
<%
RS.MoveNext
NextRecordNumber = NextRecordNumber+1
Loop
%>

</table>

<p><br>

<%
else ' NOT RS.EOF
if NextRecordNumber = 1 then
Response.Write "无文档匹配查询<P>"
else
Response.Write "查询中没有更多文档<P>"
end if

end if ' NOT RS.EOF
%>

<!-- If the index is out of date, display the fact -->

<%if NOT Q.OutOfDate then%>
<p>
<i>索引是最新的。</i><br>
<%end if%>

<!-- If the query was not executed because it needed to enumerate to resolve the query instead of using the index, but AllowEnumeration was FALSE, let the user know-->

<%if Q.QueryIncomplete then%>
<p>
<i><b>查询花费太高,无法完成。</b></i><br>
<%end if%>

<!-- If the query took too long to execute (for example, if too much work was required to resolve the query), let the user know-->

<%if Q.QueryTimedOut then%>
<p>
<i><b>查询太长,无法完成。</b></i><br>
<%end if%>


<table>

<!-- This is the "previous" button. This retrieves the previous page of documents for the query.-->

<%SaveQuery = FALSE%>
<%if CurrentPage > 1 and RS.RecordCount <> -1 then ' BUGBUG - use RS.Supports(adMovePrevious)%>
<td align="left">
<form action="<%=QueryForm%>" method="post">
<input TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
<input TYPE="HIDDEN" NAME="DocAuthorRestriction" VALUE="<%=DocAuthorRestriction%>">
<input TYPE="HIDDEN" NAME="FSRest" VALUE="<%=FSRest%>">
<input TYPE="HIDDEN" NAME="FSRestVal" VALUE="<%=FSRestVal%>">
<input TYPE="HIDDEN" NAME="FSRestOther" VALUE="<%=FSRestOther%>">
<input TYPE="HIDDEN" NAME="FMMod" VALUE="<%=FMMod%>">
<input TYPE="HIDDEN" NAME="FMModDate" VALUE="<%=FMModDate%>">
<input TYPE="HIDDEN" NAME="SortBy" VALUE="<%=SortBy%>">
<input TYPE="HIDDEN" NAME="Colset" VALUE="<%=ColChoice%>">
<input TYPE="HIDDEN" NAME="Scope" VALUE="<%=Scope%>">
<input TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage-1%>">
<input TYPE="HIDDEN" NAME="RankBase" VALUE="<%=RankBase%>">

<input type="submit" value="前 <%=RS.PageSize%> 个文档">
</form>
</td>
<%SaveQuery = TRUE%>
<%end if%>

<!-- This is the "next" button. This button retrieves the next page of documents for the query.-->

<%if Not RS.EOF then%>
<td align="right">
<form action="<%=QueryForm%>" method="post">

<input TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
<input TYPE="HIDDEN" NAME="DocAuthorRestriction" VALUE="<%=DocAuthorRestriction%>">
<input TYPE="HIDDEN" NAME="FSRest" VALUE="<%=FSRest%>">
<input TYPE="HIDDEN" NAME="FSRestVal" VALUE="<%=FSRestVal%>">
<input TYPE="HIDDEN" NAME="FSRestOther" VALUE="<%=FSRestOther%>">
<input TYPE="HIDDEN" NAME="FMMod" VALUE="<%=FMMod%>">
<input TYPE="HIDDEN" NAME="FMModDate" VALUE="<%=FMModDate%>">
<input TYPE="HIDDEN" NAME="SortBy" VALUE="<%=SortBy%>">
<input TYPE="HIDDEN" NAME="Colset" VALUE="<%=ColChoice%>">
<input TYPE="HIDDEN" NAME="Scope" VALUE="<%=Scope%>">
<input TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage+1%>">
<input TYPE="HIDDEN" NAME="RankBase" VALUE="<%=RankBase%>">

<% NextString = "后 "
if RS.RecordCount <> -1 then
NextSet = (RS.RecordCount - NextRecordNumber) + 1
if NextSet > RS.PageSize then
NextSet = RS.PageSize
end if
NextString = NextString & NextSet & " 个文档"
else
NextString = NextString & " 页"
end if
%>
<input type="submit" value="<%=NextString%>">
</form>
</td>
<%SaveQuery = TRUE%>
<%end if%>

</table>


<!-- Display the page number -->

页码 <%=CurrentPage%>
<%if RS.PageCount <> -1 then
Response.Write "(共 " & RS.PageCount & " 页)"
end if %>

<%
' If either of the previous or back buttons were displayed, save the query
' and the recordset in session variables.
if SaveQuery then
set Session("Query") = Q
set Session("RecordSet") = RS
else
RS.close
Set RS = Nothing
Set Q = Nothing
set Session("Query") = Nothing
set Session("RecordSet") = Nothing
end if
%>
<% end if %>

</center>

<!--#include file ="is2foot.inc"-->

</body>
</html>
回复
tripofdream 2001-07-12
无效字符--可能是有全角字符(如全角的空格)
回复
wanwenguo 2001-07-12
windows XP,IIS6????哇!先驱!偶像!
呵呵!我没有用过,不清楚
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2001-07-12 05:40
社区公告
暂无公告