Avatar billede bgo Nybegynder
08. april 2002 - 17:20 Der er 2 kommentarer og
1 løsning

RecordCount tæller forkert???

Jeg har fundet et site-search script der er nogenlunde ligetil at gå til (jeg er stadig begynder). Men efter at have arbejdet lidt med det har jeg opdaget flere gange at antalet af fundne dokumenter ikke stemmer overens med det der vises - ligeledes med antalet af sider, hvilket er usmart i 2 henseende: Folk vil mene det ikke virker, og det forhindrer mig i at lave direkte navigation til de enkelte sider. Så vidt jeg kan se e der ikke noget i scriptet der er galt, men jeg er jo stadig begynder. Her er scriptet:

        FormBG = "bgcolor = " & chr(34) & "#FFFFFF" & chr(34)


' *** Modifying the Form's Title Text.

' The Form's title text is set on the following line.
'
' *** Modifying the Form's Search Scope.
'
' The form will search from the root of your web server's namespace and below
' (deep from "/" ). To search a subset of your server, for example, maybe just
' a PressReleases directory, modify the scope variable below to list the virtual path to
' search. The search will start at the directory you specify and include all sub-
' directories.

      FormScope = "/"


'
' *** Modifying the Number of Returned Query Results.
'
' You can set the number of query results returned on a single page
' using the variable below.

        PageSize = 10

'
' *** Setting the Locale.
'
' The following line sets the locale used for queries. In most cases, this
' should match the locale of the server. You can set the locale below.

        SiteLocale = "da"

' ********** END QUICK CUSTOMIZATION SECTIONS ***********
noise=",about,after,all,also,an,another,any,and,are,as,at,be,because,been,before,being,between,both,but,by,came,can,come,could,did,do,each,for,from,get,got,has,had,he,have,her,here,him,himself,his,how,if,in,into,is,it,like,make,many,me,might,more,most,much,must,my,never,near,now,of,on,only,or,other,our,out,over,said,same,see,should,since,some,still,such,take,than,that,the,their,them,then,there,these,they,this,those,through,to,too,under,up,very,was,way,we,well,were,what,where,which,while,who,with,would,you,your,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$,1,2,3,4,5,6,7,8,9,0,_,!,&,~,|,?,I,"

punc2="$,1234567890_!&~|? #+()"
punc="$,1234567890_!&~|?#@%^+"
%>

<%
' Set Initial Conditions
    NewQuery = FALSE
    UseSavedQuery = FALSE
    SearchString = ""

' Did the user press a SUBMIT button to execute the form? If so get the form variables.
    if Request.ServerVariables("REQUEST_METHOD") = "POST" then
        SearchString = Request.Form("SearchString")
    SearchType=Request.QueryString("SearchType")
    if SearchString<>"" then
        Session("SearchStringDisplay")=SearchString
    end if
        FreeText = Request.Form("FreeText")
    QueryForm = "Query.Asp"
    CiResultsSize = Request.Form("CiResultsSize")
    CiLimits = Request.Form("CiLimits")
        ' NOTE: this will be true only if the button is actually pushed.
        ' if Request.Form("Action") = "Search" then
            NewQuery = TRUE
        if CiLimits = "on" then
            RankBase=50
        else
            RankBase=100
        end if
        ' end if
    end if
    if Request.ServerVariables("REQUEST_METHOD") = "GET" then
        SearchString = Request.QueryString("SearchString")
    QueryForm = "Untitled-1.asp"
    CiResultsSize = Request.QueryString("CiResultsSize")
                FreeText = Request.QueryString("FreeText")
                FormScope = Request.QueryString("sc")
                RankBase = Request.QueryString("RankBase")
        if Request.QueryString("pg") <> "" then
            NextPageNumber = Request.QueryString("pg")
            NewQuery = FALSE
            UseSavedQuery = TRUE
        else
            NewQuery = SearchString <> ""
        end if
    end if

  if NewQuery then
    set Session("Query") = nothing
    set Session("Recordset") = nothing
    NextRecordNumber = 1

    'Strip punctuation from search term
    for x = 1 to len(SearchString)
      testpunc= mid(SearchString,x,1)
      if instr(punc,testpunc) then
        SearchStringErr= SearchStringErr
      else
        SearchStringErr = SearchStringErr + testpunc
      end if
    next
    SearchString = SearchStringErr


  if SearchType=0 Then
    'Strip noise words from search term
    SearchStringComp=SearchString+" "
    for x = 1 to len(SearchStringComp)
    if mid(SearchStringComp,x,1)=" " Then
        ncompare2 = ","+ncompare+","
        if instr(noise,ncompare2) = 0 then
            NewCompare=NewCompare+" "+ncompare
        End If
        ncompare=""
    else
        ncompare=ncompare+mid(SearchString,x,1)
    end if
    next       
    x = len(NewCompare)
    if left(NewCompare,1) = " " Then
      NewCompare = right(NewCompare,(x-1))
    end if
    SearchString=NewCompare
        CompSearch = "$CONTENTS " + SearchString
  end if

  if SearchType=1 Then
    CompSearch = chr(34) + SearchString + chr(34)
  end if

  if SearchType=2 Then
    'Strip noise words from search term
    SearchStringComp=SearchString+" "
    for x = 1 to len(SearchStringComp)
    if mid(SearchStringComp,x,1)=" " Then
        ncompare2 = ","+ncompare+","
        if instr(noise,ncompare2) = 0 then
            NewCompare=NewCompare+" "+ncompare
        End If
        ncompare=""
    else
        ncompare=ncompare+mid(SearchString,x,1)
    end if
    next       
    x = len(NewCompare)
    if left(NewCompare,1) = " " Then
      NewCompare = right(NewCompare,(x-1))
    end if
    SearchString=NewCompare
    slen=len(SearchString)
    for k = 1 to slen
    slet = Mid(SearchString,k,1)
      if slet <> " " then
            ss1=ss1+slet
      else
        ss1=ss1+ " AND "
      end if
    Next
        CompSearch=ss1
    If Right(CompSearch,5) = " AND " Then CompSearch = Left(CompSearch,Len(CompSearch)-5)
  end if

if SearchType=3 Then
    'Strip noise words from search term
    SearchStringComp=SearchString+" "
    for x = 1 to len(SearchStringComp)
    if mid(SearchStringComp,x,1)=" " Then
        ncompare2 = ","+ncompare+","
        if instr(noise,ncompare2) = 0 then
            NewCompare=NewCompare+" "+ncompare
        End If
        ncompare=""
    else
        ncompare=ncompare+mid(SearchString,x,1)
    end if
    next       
    x = len(NewCompare)
    if left(NewCompare,1) = " " Then
      NewCompare = right(NewCompare,(x-1))
    end if
    SearchString=NewCompare
    slen=len(SearchString)
    for k = 1 to slen
    slet = Mid(SearchString,k,1)
      if slet <> " " then
            ss1=ss1+slet
      else
        ss1=ss1+ " OR "
      end if
    Next
        CompSearch=ss1
    If Right(CompSearch,4) = " OR " Then CompSearch = Left(CompSearch,Len(CompSearch)-4)
  end if

  if SearchType=4 Then
    'Strip noise words from search term
    NCompare=""
    NewCompare=""
    SearchStringComp=SearchString+" "
    for x = 1 to len(SearchStringComp)
    if mid(SearchStringComp,x,1)=" " Then
        ncompare2 = ","+ncompare+","
        if instr(noise,ncompare2) = 0 then
            NewCompare=NewCompare+" "+ncompare
        End If
        ncompare=""
    else
        ncompare=ncompare+mid(SearchString,x,1)
    end if
    next       
    x = len(NewCompare)
    if left(NewCompare,1) = " " Then
      NewCompare = right(NewCompare,(x-1))
    end if
    SearchString=NewCompare
    CompSearch = SearchString
  end if


and1 = request.querystring("searchstring2")
and2 = request.querystring("searchstring3")
or1 = request.querystring("searchstring4")
or2 = request.querystring("searchstring5")
date1 = request.querystring("searchstring6")
days1 = request.querystring("searchstring7")
not1 = request.querystring("searchstring8")
not2 = request.querystring("searchstring9")
doc1 = request.querystring("checkbox")
doc2 = request.querystring("checkbox2")

advstr = ""

if and1 <> "" then
    advstr = advstr & " and " & and1
end if
if and2 <> "" then
    advstr = advstr & " and " & and2
end if
if or1 <> "" then
    advstr = advstr & " or " & or1
end if
if or2 <> "" then
    advstr = advstr & " or " & or2
end if
if date1 <> "" then
    advstr = advstr & " and @write > " & date1
end if
if days1 <> "" then
    advstr = advstr & " and @write > -" & days1 & "d"
end if
if not1 <> "" then
    advstr = advstr & " and not " & not1
end if
if not2 <> "" then
    advstr = advstr & " and not " & not2
end if
if doc1 <> "" and doc2 = "" then
    advstr = advstr & " and #filename *.|(htm*|,asp|) "
end if
if doc2 <> "" and doc1 = "" then
    advstr = advstr & " and #filename *.do? "
end if
if doc2 <> "" and doc1 <> "" then
    advstr = advstr & " and #filename *.|(htm*|,asp|,do?|) "
end if

    set Q = Server.CreateObject("ixsso.Query")
        set util = Server.CreateObject("ixsso.Util")
    Q.Query = CompSearch & advstr & " and not #vpath *\_* and #vpath *\selandia-ceu* and not #filename *venstre.html and not #filename *top.html and not #vpath *\regionsjaelland* and not #vpath *\admin* and not #filename Untitled* and not #filename nyjob.asp"
    Q.Catalog = "web"
    Q.SortBy = "rank[d]"
    Q.Columns = "DocTitle, vpath, filename, size, write, characterization, rank, classid, docauthor, doccomments, dockeywords, docparttitles, docsubject, contents, docappname, docpagecount, docslidecount"
    Q.MaxRecords = RankBase

        if FormScope <> "/" then
                'util.AddScopeToQuery Q, FormScope, "deep"
        end if

        if SiteLocale<>"" then
                Q.LocaleID = util.ISOToLocaleID(SiteLocale)
        end if
    On Error Resume Next
    set RS = Q.CreateRecordSet("nonsequential")

    RS.PageSize = PageSize
    Test = RS.PageSize
    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 "Fejl - ingen gemt forespørgsel"
    end if
  end if


If Err<>424 Then

  if ActiveQuery then
    if not RS.EOF then
%>


<%LastRecordOnPage = NextRecordNumber + RS.PageSize - 1
KLastRecordOnPage=LastRecordOnPage
If KLastRecordOnPage>RS.RecordCount Then KLastRecordOnPage=RS.RecordCount%>


    <p><font size="1"><a href="scene.asp" target="scene"><font face="Arial, Helvetica, sans-serif">Tilbage
      til forsiden</font></a></font></p>
    <b>Du søgte efter :<i> <%=request.querystring("SearchString")%></i>
<%
if and1 <> "" then
response.write " og <i>" & and1 & "</i>"
end if
if and2 <> "" then
response.write " og <i>" & and2 & "</i>"
end if
if or1 <> "" then
response.write " eller <i>" & or1 & "</i>"
end if
if or2 <> "" then
response.write " eller <i>" & or2 & "</i>"
end if
if not1 <> "" then
response.write " men ikke <i>" & not1 & "</i>"
end if
if not2 <> "" then
response.write " og ikke <i>" & not2 & "</i>"
end if
if date1 <> "" then
response.write " som er ændret <i>" & date1 & "</i> eller senere"
end if
if days1 <> "" then
response.write " som er ændret indenfor <i>" & days1 & "</i> dage"
end if
if doc1 <> "" and doc2 = "" then
response.write " blandt alle <i>Web-dokumenter</i>"
end if
if doc2 <> "" and doc1 = "" then
response.write " blandt alle <i>Word-dokumenter</i>"
end if
if doc1 <> "" and doc2 <> "" then
response.write " blandt alle <i>Web-dokumenter</i> og <i>Word-dokumenter</i>"
end if
if doc1 = "" and doc2 = "" then
response.write " blandt alle dokumenter"
end if
%>
</b><br>
<i>
<b><%=NextRecordNumber%> - <%=KLastRecordOnPage%> af <%=RS.RecordCount%> resultater fundet</b></i>
<p>

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

%>

<%

%>

<% if Not RS.EOF and NextRecordNumber <= LastRecordOnPage then%>
        <table border=0>
<% end if %>

<%

Do While Not RS.EOF and NextRecordNumber <= LastRecordOnPage

        ' This is the detail portion for Title, Description, URL, Size, and
    ' Modification Date.



TmpExt = Server.HTMLEncode( RS("filename") )
FullExt = Right(TmpExt, 3)

If FullExt <> "cnt" and FullExt <> "hhc" and FullExt <> "hpj" and FullExt <> "hlp" and FullExt <> "rtf" and FullExt <> "asf" and FullExt <> "gid" and FullExt <> "fts" and FullExt <> "wmp" and FullExt <> "hhk" and FullExt <> "txt" and FullExt <> "ass" and FullExt <> "idq" and FullExt <> "ncr" and FullExt <> "ncl" and FullExt <> "url" and FullExt <> "css" and FullExt <> "prp" and FullExt <> "htx" and FullExt <> "htw" and FullExt <> "tmp" and FullExt <> "mdb" and FullExt <> "xls" and FullExt <> "chm" Then

if len(rs("doctitle")) > len("Selandia - Center for Erhvervsuddannelse") and left(rs("doctitle"), len("Selandia - Center for Erhvervsuddannelse")) = "Selandia - Center for Erhvervsuddannelse" then
    displaytitle = right(rs("doctitle"), len(rs("doctitle")) - 43)
else
    displaytitle = rs("doctitle")
end if

if len(displaytitle) < 3 then
    displaytitle = rs("doctitle")
end if

testpath = left(RS("vpath"), 13)
if testpath = "/selandia-ceu" then
    path = right(RS("vpath"), len(rs("vpath")) - 13)
else
    path = rs("vpath")
end if


'word (doc)
if RS("classid") = "{00020906-0000-0000-C000-000000000046}" or RS("classid") = "{00020900-0000-0000-C000-000000000046}" then
    doctype = "<img src='doc.gif' alt='" & RS("docappname") & "' border=0>"
else
'html
if RS("classid") = "{25336920-03F9-11CF-8FD0-00AA00686F13}" then
    doctype = "<img src='htm.gif' alt='Web-dokument' border=0>"
else
'powerpoint
if RS("classid") = "{64818D10-4F9B-11CF-86EA-00AA00B929E8}" then
    doctype = "<img src='ppt.gif' alt='" & RS("docappname") & "' border=0>"
else
'asp
if RS("classid") = "{BD70C020-2D24-11D0-9110-00004C752752}" then
    doctype = "<img src='htm.gif' alt='Web-dokument' border=0>"
else
'eml outlookexpress mail
if RS("classid") = "{5645C8C3-E277-11CF-8FDA-00AA00A14F93}" then
    doctype = "<img src='eml.gif' alt='Outlook Express post-dokument' border=0>"
else
if RS("classid") = "" then
    doctype = "<img src='removed.gif' alt='Dokumentet er fjernet' border=0>"
else
'    doctype = "Ukendt"
    doctype = RS("classid")
end if
end if
end if
end if
end if
end if

if left(path, 11) = "/afdelinger" or left(path, 5) = "/kl60" then
    vtarget = "_blank"
else
    vtarget = "_top"
end if

    ' If there is a title, display it, otherwise display the filename.



%>

    <p>
    <tr class="RecordTitle">
            <td><font face="Verdana" size="1"><b><%=NextRecordNumber%>.</b></td>
        <b class="RecordTitle"> <td><table width="100%" border="1" cellspacing="0" cellpadding="1" bordercolor="#FFFFFF">
        <tr>
        <td align="left" width="54%"><b>
            <%if VarType(RS("DocTitle")) = 1 or Len(RS("DocTitle")) < 3 then%>
                <font face="Verdana" size="1">
                <a href="<%=path%>" target="<%=vtarget%>" class="RecordTitle"><%=doctype%>&nbsp;<%= Server.HTMLEncode( RS("filename") )%></a></font></td>
    <td align="left" width="31%"><font face="Verdana" size="1"><font color="#999999">(Match p&aring; s&oslash;geord: <%=RS("rank")/10%>%)</font></font></td>
    <td align="right" width="15%"><font face="Verdana" size="1"><%
    if doctype = "<img src='doc.gif' alt='" & RS("docappname") & "' border=0>" then
    %>
    <b><%=RS("docpagecount")%>&nbsp;side(r)</b>
    <%
    end if
    if doctype = "<img src='ppt.gif' alt='" & RS("docappname") & "' border=0>" then
    %>
    <b><%=RS("docslidecount")%>&nbsp;slide(s)</b>
    <%
    end if
    %>
   
                <%else%>
                <font face="Verdana" size="1">
                <a href="<%=path%>" target="<%=vtarget%>" class="RecordTitle"><%=doctype%>&nbsp;<%= Server.HTMLEncode(displaytitle)%></a></font></td>
    <td align="left" width="31%"><font face="Verdana" size="1"><font color="#999999">(Match p&aring; s&oslash;geord: <%=RS("rank")/10%>%</font></font></td>
    <td align="right" width="15%"><font face="Verdana" size="1"><%
    if doctype = "<img src='doc.gif' alt='" & RS("docappname") & "' border=0>" then
    %>
    <b><%=RS("docpagecount")%>&nbsp;side(r)</b>
    <%
    end if
    if doctype = "<img src='ppt.gif' alt='" & RS("docappname") & "' border=0>" then
    %>
<b>    <%=RS("docslidecount")%>&nbsp;slide(s)</b>
    <%
    end if
    %>
            <%end if%>
        </b></td>
  </tr>
  <tr bgcolor="#FFFFCC" bordercolor="#A6FFA6">
    <td colspan="3"><font face="Verdana" size="1">
            <%if VarType(RS("characterization")) = 8 and RS("characterization") <> "" then%>
                <%= RS("characterization")%></font></td>
  </tr>
  <tr>
    <td width="54%"><b><font face="Verdana" size="1">
        <%=RS("size")%> bytes</font></b></td>
    <td align="right" colspan="2"><b><font face="Verdana" size="1">Sidst opdateret: <%=RS("write")%></font></b></td></tr></table>
        <%end if%>
        <%if CiResultsSize = "on" then%>
                <%end if%>
        </td>
    </tr>
    <tr>
    </tr>
<%
else
  NextRecordNumber = NextRecordNumber-1
end if
          RS.MoveNext
          NextRecordNumber = NextRecordNumber+1
      Loop
%>
</table>
<P><BR>
<%
  else  ' NOT RS.EOF
      if NextRecordNumber <> 1 then
          Response.Write "No more documents in the query.<P>"
      end if

  end if ' NOT RS.EOF
 
  if Q.QueryIncomplete then
'    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 %>
    <P>
    <I><B>The query could not be completed. Please resubmit the query.<BR> Technical details: AllowEnumeration must be set to TRUE to complete this query.</B></I><BR>
<%end if
  if Q.QueryTimedOut then
'    If the query took too long to execute (for example, if too much work
'    was required to resolve the query), let the user know %>
    <P>
    <I><B>The query took too long to complete.</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 %>
    <td align=left>
        <form action="<%=QueryForm%>" method="get" id="tilbage">
            <INPUT TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
                        <INPUT TYPE="HIDDEN" NAME="FreeText" VALUE="<%=FreeText%>">
        <INPUT TYPE="HIDDEN" NAME="CiResultsSize" VALUE="<%=CiResultsSize%>">
            <INPUT TYPE="HIDDEN" NAME="sc" VALUE="<%=FormScope%>">
            <INPUT TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage-1%>" >
            <INPUT TYPE="HIDDEN" NAME = "RankBase" VALUE="<%=RankBase%>">
        <font face="Verdana" size="1" color="#999999">
            <a href="java script: tilbage.submit();"><< Tilbage</a>
        </form>
    </td>
        <%SaveQuery = TRUE
        end if
       
'    This is the "next" button for unsorted queries.
'    This retrieves the next page of documents for the query.

  if Not RS.EOF then%>
    <td align=right>
        <form action="<%=QueryForm%>" method="get" id="frem">
            <INPUT TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
                        <INPUT TYPE="HIDDEN" NAME="FreeText" VALUE="<%=FreeText%>">
        <INPUT TYPE="HIDDEN" NAME="CiResultsSize" VALUE="<%=CiResultsSize%>">
            <INPUT TYPE="HIDDEN" NAME="sc" VALUE="<%=FormScope%>">
            <INPUT TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage+1%>" >
            <INPUT TYPE="HIDDEN" NAME = "RankBase" VALUE="<%=RankBase%>">
        <font face="Verdana" size="1" color="#999999">
            <a href="java script: frem.submit();">Frem >></a>
        </form>
    </td>
    <%SaveQuery = TRUE
    end if%>

</TABLE>

<% ' Display the page number
if RS.RecordCount = 0 then%>
        Ingen dokumenter svarer til forespørgslen: <%=SearchString%>.<br><br>

    Du kan:
    <UL><LI>Søge efter realterede emner.
    <LI>Kontroller stavning.
    <LI>Prøve en anden søgemetode (Standard, nøjagtig sætning, valgfrit ord, alle ord og Boolean kan anvendes).
    <LI>Prøv din forespørgsel senere.
    </UL>
    <%else%>

Side <%=CurrentPage%>
<%
if RS.PageCount <> -1 then
    Response.Write " af " & RS.PageCount
  end if
  end if
%>
    <p> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Du kan foretage
      ny søgning eller forbedre din nuværende nedenfor. Du behøver kun at udfylde
      de felter du skal bruge.</font></p>
<form ACTION="Untitled-1.asp" METHOD="get" target="_top">
      <table width="100%" border="0" cellspacing="2">
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">S&oslash;geord:</font></td>
          <td>
            <input TYPE="TEXT" NAME="SearchString" SIZE="17" class=formfelter value="<%=request.querystring("searchstring")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Og</font></td>
          <td>
            <input type="TEXT" name="SearchString2" size="17" class=formfelter value="<%=request.querystring("searchstring2")%>">
          </td>
        </tr>
        <tr>
          <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Og</font></td>
          <td>
            <input type="TEXT" name="SearchString3" size="17" class=formfelter value="<%=request.querystring("searchstring3")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Eller</font></td>
          <td>
            <input type="TEXT" name="SearchString4" size="17" class=formfelter value="<%=request.querystring("searchstring4")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Eller</font></td>
          <td>
            <input type="TEXT" name="SearchString5" size="17" class=formfelter value="<%=request.querystring("searchstring5")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Men
            ikke </font></td>
          <td>
            <input type="TEXT" name="SearchString8" size="17" class=formfelter value="<%=request.querystring("searchstring8")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Og ikke</font></td>
          <td>
            <input type="TEXT" name="SearchString9" size="17" class=formfelter value="<%=request.querystring("searchstring9")%>">
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Dato</font></td>
          <td>
            <input type="TEXT" name="SearchString6" size="17" class=formfelter value="<%=request.querystring("searchstring6")%>">
            <font face="Verdana, Arial, Helvetica, sans-serif" size="2">&aring;&aring;&aring;&aring;-mm-dd</font>
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">&AElig;ndret
            indenfor</font></td>
          <td>
            <input type="TEXT" name="SearchString7" size="17" class=formfelter value="<%=request.querystring("searchstring7")%>">
            <font face="Verdana, Arial, Helvetica, sans-serif" size="2">dage</font>
          </td>
        </tr>
        <tr>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Dokumenttype</font></td>
          <td> <input type="checkbox" name="checkbox" value="checkbox" class="formfelter" <%  if request.querystring("checkbox") <> "" then %>checked<% end if %>>
            <font size="2" face="Verdana, Arial, Helvetica, sans-serif">Web-dokument</font> <input type="checkbox" name="checkbox2" value="checkbox" class="formfelter" <% if request.querystring("checkbox2") <> "" then %>checked<% end if %>>
            <font face="Verdana, Arial, Helvetica, sans-serif" size="2">Word-dokument
            </font></td>
        </tr>
        <tr>
          <td></TD>
          <td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">(hvis
            ingen er markeret, søges på alle dokumenttyper)</font></td>
        </tr>
      </table>
  <input TYPE="Submit" VALUE="Søg" class=formfelter>
</form>
<%
    ' 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 %>
</BODY>
</HTML>
<%else

    'Strip noise words from search term
    NCompare=""
    NewCompare=""
    SearchStringComp=SearchString+" "
    for x = 1 to len(SearchStringComp)
    if mid(SearchStringComp,x,1)=" " Then
        ncompare2 = ","+ncompare+","
        if instr(noise,ncompare2) = 0 then
            NewCompare=NewCompare+" "+ncompare
        End If
        ncompare=""
    else
        ncompare=ncompare+mid(SearchString,x,1)
    end if
    next       
    x = len(NewCompare)
    if left(NewCompare,1) = " " Then
      NewCompare = right(NewCompare,(x-1))
    end if
    SearchString=NewCompare

    'Strip punctuation from search term
    SearchStringErr = ""
    for x = 1 to len(SearchString)
      testpunc= mid(SearchString,x,1)
      if instr(punc2,testpunc) then
        SearchStringErr= SearchStringErr
      else
        SearchStringErr = SearchStringErr + testpunc
      end if
    next
    SearchString = SearchStringErr
    CompSearch=SearchString

if SearchString = "" or instr(SearchString,"*") or instr(CompSearch,")") or instr(CompSearch,"(") or right(CompSearch,3)="OR " or right(CompSearch,4)="AND " then%>
<b>Din forespørgsel kunne ikke udføres!.<p></b><br>

<%end if
end if
end if %>

    </td>
    </tr>
    </table>
Avatar billede Søren Bech Morsing Praktikant
10. april 2002 - 12:14 #1
dit recordset object understøtter ikke recordcount

prøv med
   
    SQLQuery = "SELECT * FROM tabel"
    Set rs = Server.CreateObject("ADODB.RecordSet")
    rs.open SQLQuery, conn, 3, 2
Avatar billede bgo Nybegynder
10. april 2002 - 15:30 #2
Hmm. Såvidt jeg har forstået det skulle dette udgøre det for det samme:

set Q = Server.CreateObject("ixsso.Query")
...
set RS = Q.CreateRecordSet("nonsequential")

blot at dataene kommer fra Q i stedet for en database.

Men recordcount og pagecount tæller rigtig de fleste gange, men somme tider siger de at der er op til dobbelt så mange records end det der bliver vist. Med den aktivitet der er på vores server (opret/slet filer) tror jeg ikke på at det er det der kan gøre at de somme tider tæller SÅ meget forkert.
Men det kunne måske være i selve fremvisningen der går noget galt??

Under alle omstændigheder kan du prøve at søge på henholdsvis "erhvervsskolen" som giver disse underligheder og "biblioteker" som ikke gør på www.selandia-ceu.dk/av.asp
Avatar billede bgo Nybegynder
07. maj 2002 - 12:28 #3
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester