Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search page not working -- can't be THAT hard, right?

Status
Not open for further replies.

LuckyDuck528

Programmer
Dec 21, 2004
65
US
This can't be THAT hard but I'm stuck. I'll be the first to admitt I'm no developer but I can code and this is stumping me!

I am migrating a website from an NT Server with IIS 4.0 TO a Win2003 Server with II6.0. Everything is going fine except that my search on the main page will no longer work. The code has not changed and as far as I can tell all of the necessary files, etc. for the search are present as well.

The working site is The new site being migrated to is
You will see the error I get is:
Code:
CreateRecordset error '80004005' 

Unspecified error 

/search.asp, line 229

When you google the Error number it comes back with all sorts of Database problem suggestions...

Any ideas on how to interpret this would be appreciated.
The database has not moved or changed names.

Have a great day!

Thanks,
LuckyDuck528
 
Well first thing is to take a look at line 229.

If you don't have an editor that shows line numbers you can download TextPad... A text editor that shows line numbers can really come in handy!

Anyway I suspect the problem is that the new server can't connect to some database. Perhaps the code was using a DSN to connect and the DSN is not defined on the new server? Or maybe it is on a different part of the network and can't reach the server?

Those are really just shots in the dark... if line 229 doesn't mean anything to you then post it and the surrounding code here and perhaps we can give better tips based on that new information.
 
I would think it would be a database connection problem too BUT, I downloaded an example search page from Microsoft and put it in the SAME folder as MY search page and wouldn't ya know it... the Microsoft page works!


SINIPPIT OF MINE THAT DOES NOT WORK:
Code:
Set objQuery = Server.CreateObject("ixsso.Query")

....

With objQuery
   .Query = strFullSearchString
   .SortBy = "rank[d],write[d]" 			
   .Columns = "DocTitle, vpath, path, filename, size, write, characterization, rank"
   .MaxRecords = "300" 'return 300 records max
   .Catalog = "WebExt01" 'use this line for p.com
   .CiFlags = "DEEP"
   .AllowEnumeration = True
[COLOR=red]		
Set objRS = .CreateRecordset("nonsequential")
[/color]
End With

FULL CODE OF MS PAGE THAT DOES WORK:
Code:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Index Server Example Search Results Page</title>
</head>

<body>
<%
Dim sSearchString
Dim oQuery

sSearchString = Request.Form("query")

Const SEARCH_CATALOG = "WebExt01" 'remember to change this
%>
<%
Set oQuery = Server.CreateObject("IXSSO.Query")

oQuery.Catalog = SEARCH_CATALOG
oQuery.Query = "@all " & sSearchString & " AND NOT #path *_* AND NOT #path *downloads* AND NOT #path *images* AND NOT #filename *.class AND NOT #filename *.asa AND NOT #filename *.css AND NOT #filename *postinfo.html"
oQuery.MaxRecords = 200
oQuery.SortBy = "rank[d]"
oQuery.Columns = "DocAuthor, vpath, doctitle, FileName, Path, Write, Size, Rank, Create, Characterization, DocCategory"
Set oRS = oQuery.CreateRecordSet("nonsequential")
%>
<%
If oRS.EOF Then
Response.Write "No pages were found for the query <i>" & sSearchString & "</i>"
Else
Do While Not oRS.EOF

Response.write "<b>FileName:</b> " & oRS("FileName") & "<br>"
Response.write "<b>doctitle:</b> " & oRS("doctitle") & "<br>"
Response.write "<b>Size:</b> " & oRS("Size") & "<br>"
Response.write "<b>Create:</b> " & oRS("Create") & "<br>"
Response.write "<b>Write:</b> " & oRS("Write") & "<br>"
Response.write "<b>Characterization:</b> " & oRS("Characterization") & "<hr>"

oRS.MoveNext
Loop
End If
%>
<%
Set oRS = nothing
Set oQuery = nothing
%>
</body>
</html>
 
IF you need/would like to see more/all of my code on that page let me know.

Sorry!
 
Where Request.Form("query") comes from... another page?

What happens if you hard-code sSearchString value and try again?

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Does your page work if you use the same values as the microsoft demo page for the properties Query, SortBy, and Columns ?
 
I would suggest you to Response.Write your query string and see whether everything is set correctly...

-DNG
 
Sheco,

No the page does NOT work when I use the same valuse as the microsoft demo.
 
Actually Sheco, when I tried that I got a new error that said:
Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'sSearchString'

/search.asp, line 221
 
how about this...
I actually just tried to make the page do it's search through the Microsoft page that does works and I Still got the same error that I have been getting the whole time. Different file, differnt line number, same line of code...


Set objRS = .CreateRecordset("nonsequential")

 
Sounds like the problem might be the query syntax.

Maybe try something like:

objQuery.Query = "Hard code the most simple query possible"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top