Et søgeresultat på flere sider
Nu har jeg lavet en søgeside, som finder et resultat frem, som med min paping giver flere sider.Hvis jeg med min navigation hopper frem til næste side, hopper den ud af min søgning - den bevarer ikke resultatet med de kriterier, jeg har sat.
How to do, please???
Her er koden:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="dwzPaging/dwzPaging.asp" -->
<!--#include file="Connections/pegasusDB.asp" -->
<%
Dim pegatest__navnparam
pegatest__navnparam = "%"
If (Request.Form("formnavn") <> "") Then
pegatest__navnparam = Request.Form("formnavn")
End If
%>
<%
Dim pegatest__gadeparam
pegatest__gadeparam = "%"
If (Request.Form("formgade") <> "") Then
pegatest__gadeparam = Request.Form("formgade")
End If
%>
<%
Dim pegatest
Dim pegatest_cmd
Dim pegatest_numRows
Set pegatest_cmd = Server.CreateObject ("ADODB.Command")
pegatest_cmd.ActiveConnection = MM_pegasusDB_STRING
pegatest_cmd.CommandText = "SELECT * FROM qBeboere WHERE Navn like ? and Gade like ? ORDER BY Navn"
pegatest_cmd.Prepared = true
pegatest_cmd.Parameters.Append pegatest_cmd.CreateParameter("param1", 200, 1, 255, "%" + pegatest__navnparam + "%") ' adVarChar
pegatest_cmd.Parameters.Append pegatest_cmd.CreateParameter("param2", 200, 1, 255, "%" + pegatest__gadeparam + "%") ' adVarChar
Set pegatest = pegatest_cmd.Execute
pegatest_numRows = 0
%>
<%
'*********************************
'* RECORDSET PAGING - NUMERIC
'* http://www.dwzone-it.com
'* Version 1.1.0
'*********************************
set dwzPaging_0 = new dwzRecPaging
dwzPaging_0.init()
dwzPaging_0.setTypeNumeric()
dwzPaging_0.setRecordset pegatest
dwzPaging_0.setRecPaging 10
dwzPaging_0.setPages 5
dwzPaging_0.setStyle "None", "None", "None"
dwzPaging_0.setText ">>", "<<", "Første", "Sidste"
dwzPaging_0.setSeparator " | "
dwzPaging_0.setLinkMask "[ {1} ]"
dwzPaging_0.Execute()
set pegatest = dwzPaging_0.getRecordset()
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
pegatest_numRows = pegatest_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="pegatest.asp">
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Navn:</td>
<td><label>
<input type="text" name="formnavn" id="formnavn" />
</label></td>
</tr>
<tr>
<td>Gade:</td>
<td><input type="text" name="formgade" id="formgade" /></td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="submit" name="button" id="button" value="Søg" />
</label></td>
</tr>
</table>
</form>
<p>
<table width="600" border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Navn</td>
<td>Gade</td>
<td>Sal</td>
<td><p>Side</p> </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT pegatest.EOF))
%>
<tr>
<td><%=(pegatest.Fields.Item("Navn").Value)%></td>
<td><%=(pegatest.Fields.Item("Gade").Value)%></td>
<td><%=(pegatest.Fields.Item("Sal").Value)%></td>
<td><%=(pegatest.Fields.Item("Side").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
pegatest.MoveNext()
Wend
%>
</table>
<p>
<%
'*********************************
'* RECORDSET PAGING - NUMERIC
'*********************************
dwzPaging_0.GetPaging()
'*********************************
'* RECORDSET PAGING - NUMERIC
'*********************************
%>
</body>
</html>
<%
pegatest.Close()
Set pegatest = Nothing
%>
<%
'*********************************
'* RECORDSET PAGING - NUMERIC
'*********************************
set dwzPaging_0 = nothing
'*********************************
'* RECORDSET PAGING - NUMERIC
'*********************************
%>