Re: CreateRecordset error '80004005'
From: Hilary Cotter (hilaryk_at_att.net)
Date: 08/20/04
- Previous message: Tom Pepper Willett: "Re: Done all the checks and still no search working"
- In reply to: Jay Swan: "CreateRecordset error '80004005'"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: CreateRecordset error '80004005'"
- Reply: anonymous_at_discussions.microsoft.com: "Re: CreateRecordset error '80004005'"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Aug 2004 14:02:49 -0400
According to your code, you will never get if strQuery<>"" to evalute to
true.
I think you should do this
if sSearchString <> "" then
-- Hilary Cotter Looking for a book on SQL Server replication? http://www.nwsu.com/0974973602.html "Jay Swan" <anonymous@discussions.microsoft.com> wrote in message news:a1b301c486c4$3f6bfc10$a601280a@phx.gbl... > This code works fine, however the first time through the > code it throws the subject line error. > > It must have something to do with the following line of > code : > > If strQuery <> "" then > > What is the best way to trap and perform an if statement > on if the query box has just loaded and is empty(?) > > TIA > > Jay > > > <% > Dim strQuery ' The text of our query > Dim objQuery ' The index server query object > Dim rstResults ' A recordset of results returned from I.S. > Dim objField ' Field object for loop > > ' Retreive the query from the querystring > sSearchString = Request.QueryString("search") > strQuery ="@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 *search.html AND NOT > #filename *search.asp" > > > 'If the query isn't blank them proceed > 'If not isempty(strQuery) Then > 'Here is the issue... > If strQuery <> "" then > ' Create our index server object > Set objQuery = Server.CreateObject("IXSSO.Query") > > ' Set it's properties > With objQuery > .Catalog = "CatalogName" ' Catalog to > query > .Query = strQuery ' Query text > > ' What to sort records by. I'm sorting by > rank [d] > ' which is [d]escending by how pertinent > Index Server > ' thinks the result is. This way the most > applicable > ' result should be first. > .SortBy = "rank [d]" > > ' Which columns to return. Column names > must > ' be the same as the catalog's > properties. Some > ' of them are: contents, filename, size, > path, > ' vpath, hitcount, rank, create, write, > DocTitle > ' DocSubject, DocAuthor, DocKeywords... > .Columns = "filename, path, vpath, size, > write, " _ > & "Characterization, DocTitle, > DocAuthor, " _ > & "DocKeywords, rank, hitcount" > End With > > ' Get a recordset of our results back from Index > Server > Set rstResults = objQuery.CreateRecordset > ("nonsequential") > > ' Get rid of our Query object > Set objQuery = Nothing > > ' Check for no records > If rstResults.EOF Then > Response.Write "<tr><td><p><strong>" > Response.Write "Sorry. No results found." > Response.Write "</strong></p></td></tr>" > Else > ' Print out # of results > Response.Write "<tr><td align='right' > CLASS='Body'><p><b>" > Response.Write "Records > Located : " > Response.Write rstResults.RecordCount > > Response.Write "</p></b></td></tr><tr><td> </t > d></tr>" > > ' Loop through results > %> > > <!-- <table align="right" cellpadding="0" > cellspacing="0" border="2" width="555"> --> > <% > NumeroMassimo=1 > rstResults.PageSize=parGrandezzaPagina > NumeroMassimo=cint(rstResults.PageCount) > rstResults.AbsolutePage=parQualePagina > > Do While Not rstResults.EOF and > parQuantiRecord < rstResults.PageSize > %> > <TR> > <TD CLASS="Body"><b><% Response.Write > rstResults.Fields("doctitle")%> </b></TD> > </TR> > <TR> > <TD CLASS="Body"><p><% Response.Write > rstResults.Fields("Characterization")%></p></TD> > </TR> > <TR> > <TD CLASS="Body"><A > CLASS="BodyLink" HREF='<% Response.Write rstResults.Fields > ("vpath") %>'>See more</A><A > HREF='/en/countries/asia/indonesia.html' > CLASS='BodyArrow'>>></A></TD> > </TR> > <tr><td> </td></tr> > <% > i=i+1 > rstResults.MoveNext > strRecordInQuestaPagina = > strRecordInQuestaPagina + 1 > parQuantiRecord=parQuantiRecord+1 > Loop > End If > Set rstResults = Nothing > %> >
- Previous message: Tom Pepper Willett: "Re: Done all the checks and still no search working"
- In reply to: Jay Swan: "CreateRecordset error '80004005'"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: CreateRecordset error '80004005'"
- Reply: anonymous_at_discussions.microsoft.com: "Re: CreateRecordset error '80004005'"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|