Вопрос

I want to use Microsoft indexing service to search a folder which includes the static pages, the following is the source code.

<html>
<%
' This section sets the various configuration variables

formscope="/"
pagesize = 5000
maxrecords=5000
searchstring=request.form("query")
catalogtosearch="cat"
searchrankorder="rank[d]"
origsearch=searchstring
%>

<%
'This section performs the query

dim q
dim util
set q=server.createobject("ixsso.query")
set util=server.createobject("ixsso.util")
q.query=searchstring
q.catalog=catalogtosearch
q.sortby=searchrankorder
q.columns="doctitle, filename, size, write, rank, directory, path"
q.maxrecords=maxrecords
%>

<%
'This section displays the results

set rs=q.createrecordset("nonsequential")
rs.pagesize=pagesize
response.write"<p>Your search for <b>" & origsearch & "</bproduced "

if rs.recordcount=0 then response.write "no results"
if rs.recordcount=1 then response.write "1 result: "
if rs.recordcount>1 then response.write(rs.recordcount) & " results: "

%>

<table border=1><tr><td><b>Title</b></td><td><b>Filename</b></td><td><b>Date / Time</b></td><td><b>Size</b></td><td><b>Relevance</b></td><td><b>Directory</b></td></tr>

<%
do while not rs.EOF

response.write "<tr><td>" & rs("doctitle") & "</td><td>" & "<a href=" & "'" & rs("path") & "'" & ">" & rs("filename") & "</a>" & "</td><td>" & rs("write") & "</td><td>" & rs("size") & "</td><td>" & rs("rank") & "</td><td>" & rs("directory") & "</td></tr>"

rs.movenext
loop

response.write "</table>"
set rs=nothing
set q=nothing
set util=nothing
%>

</body>
</html>

I have added a catalog in computer -> management -> indexing service, and under cat catalog, I also add the directory, but when I run the script above there is an error:

CreateRecordset error '80004002'

No such interface supported

/cat/SearchResults.asp, line 31

Anyone knows what is the error? Thanks.

Это было полезно?

Решение

as my original anwser was deleted for some obscure reason i try to answer your question again.

as you could see in this link "You can’t use IXSSO to query an Index Server catalog after you install hotfix 2698365 in Windows 7 or Windows Server 2008 R2".

i copy the text from the linked page to my anwser because @Mario wants that:

SYMPTOMS: After you install update 2698365 on a computer that is running Windows 7 or Windows Server 2008 R2, you cannot query an Index Server catalog by using the IXSSO component. Specifically, when you try to call the IXSSO.Query.CreateRecordset method, you receive an error message that resembles the following: No such interface supported -2147467262

CAUSE: "This issue occurs because an old installation of ActiveX Data Objects (ADO) is removed after you install update 2698365."

RESOLUTION: install the hotfix from the linked site

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top