Next link
hey thereI have an asp page that displays search results how ever I am trying to insert a next function that will have only 5 results displayed per page and if there are more results then a link will be displayed to click on and then look at the next 5 results
this is the script however it displays a error that says
Microsoft VBScript runtime error \'800a01a8\'
Object required: \'\'
/kongen/search_result.asp, line 91
heres the script
<% Response.Buffer = True %>
<html><head>
<title>Kongengade Search Results</title>
</head><body>
<link rel=\"stylesheet\" style=\"text/css\" href=\"styles_old.css\">
<table width=\"750\" align=\"center\" valign=\"top\" border=\"0\">
<table width=\"750\" align=\"center\" valign=\"top\" border=\"0\">
<tr><td>
<table width=\"750\" align=\"center\" valign=\"top\" border=\"0\">
<tr>
<td align=\"left\"><img src=\"images/default_logo.gif\" border=\"0\"></td><td align=\"right\" valign=\"top\"><form
method=\"POST\" action=\"userinfo.asp\">
<input type=\"password\" name=\"pass\" size=\"10\"></td><td align=\"right\" valign=\"top\"><input type=\"submit\" value=\"Login\"
name=\"Action\">
</form></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><a href=default.asp>TILBAGE</a> <a href=info.asp>INFO OM</a></td>
<tr>
<tr><td class=\"one\" align=\"center\" bgcolor=\"5B707D\">
<table width=\"750\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td valign=\"top\">
<%
\' Henter værdien fra soeg.asp
strKeyword = Trim(Request.Form(\"Keyword\"))
If Len(strKeyword) = 0 Then
\' Hvis der ikke er skrevet i feltet
Response.Clear
Response.Redirect(\"search_result.asp\")
Else
\' Hvis der er skrevet i feltet
strKeyword = Replace(strKeyword,\"\'\",\"\'\'\")
End If
\' Opbygger en dynamisk SQL streng
strSQL = \"SELECT * FROM adresse WHERE\"
strSQL = strSQL & \" (info_om LIKE \'%\" & strKeyword & \"%\')\"
strSQL = strSQL & \" OR (henviser_til LIKE \'%\" & strKeyword & \"%\')\"
\' Skaber DSNLess forbindelse til DBen
strDSN = \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\"&Server.MapPath(\"adresse.mdb\")
Set myConn = Server.CreateObject(\"ADODB.Connection\")
myConn.Open strDSN
\' Skaber et recordset udfra SQL strengen
Set rs = myConn.Execute(strSQL)
If Not (rs.BOF Or rs.EOF) Then
\' Hvis der er fundet poster på søgningen
Response.Write \"<table width=100% valign=top border=0 cellpadding=0 cellspacing=5>\"
Response.Write \"<tr><td colspan=1 align=right><form method=POST action=search_result.asp><b>Søg:
</b><input type=text name=Keyword size=20><input type=submit value=Search name=Action></td></tr>\"
Do While Not rs.EOF
Response.Write \"<tr><td width=100% class=one bgcolor=0A223A><table width=100% cellpadding=5><tr><td
width=100% bgcolor=0A223A><b><h4>\" & rs(\"navn\") & \"</h4></b></td></tr>\"
Response.Write \"<tr><td><a href=vis_data_alt.asp?id=\" & rs(\"Id\") & \">\" & rs(\"link\") & \"</a></td></tr>\"
Response.Write \"<tr><td><img width=468 height=60 border=1 src=images/\" & rs(\"banner\") & \"></td></tr>\"
Response.Write \"<tr><td>\" & rs(\"info_om\") & \"</td></tr></table>\"
rs.MoveNext
Loop
Response.Write \"</td></tr></table>\"
Else
Response.Write \"<table border=0 width=500 align=center valign=top cellpadding=5 cellspacing=0><tr><td align=left
valign=top><b>Du fik 0 hits tilbage</b></td></tr><tr><td align=left>Prøv igen måske ?</td></tr><tr><td align=left><a
href=default.asp>Søg Igen</a></td></tr></table>\"
End If
myConn.Close
Set myConn = Nothing
%>
</tr>
<tr>
<%
Page = cINT(currentPage)
If Page > 1 Then
PrevPage = Page - 1 %>
<td><a href=\"search_result.asp?currentPage=<%=PrevPage%>&ID=<%=ID%>\"><b>Forrige side</b></a></td>
<% Else %>
<td> </td>
<%End if %>
<td> </td>
<%
If Page < RS_Outer.PageCount Then
NextPage = Page + 1 %>
<td><a href=\"search_result.asp?currentPage=<%=NextPage%>&ID=<%=ID%>\"><b>Næste side</b></a></td>
<% Else %>
<td> </td>
<%End If %>
</tr>
<tr>
<td colspan=\"3\"><hr></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</table>
</td>
</tr>
</table>
</body></html>
Guzzie (Big time nubie)