salut tout le monde,
j ai bien souffert avec un probleme depuis quelques jours, le voici :
j ai un combobox qui a été rempli à partir d une BD access, quand je fais un choix (OnChange), les résultats s'affichent en bas dans un tableau dans la meme page, jusque la tout est bien
mais le probleme est au niveau de PAGINATION (Précédent/Suivant) , quand je fais un choix, on m'affiche par exemple :
de 1 à 4 alors quand je clique sur "Suivant" il m 'affiche la 2 eme page du résultat de toutes les enregistrements de la table et en bas la pagination de tous comme ca : de 2 à 20
Merci de votre aide
si vous voulez telecharger mon test voila le lien (13Ko)
[ Lien ] &
voila le code de ma page :
<%set conn=server.createobject("adodb.connection")
DSN = "DBQ=" & Server.Mappath("../database/basefrmt.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};Driverld=25"
conn.open DSN
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
set cate2=server.createobject("adodb.recordset")
set arb=server.createobject("adodb.recordset")
sqls="select * from categorie order by id_cat"
cate2.open sqls, conn
if request.Form("cate")<>"all" then
session("cates")=request.Form("cate")
else if request.Form("cate")="all" then
session("cates")=""
end if
end if
sqla="select * from arbitre"
if session("cates")<>"" then
if request.Form("hide")="2" then
if request.Form("cate")<>"all" then
sqla=sqla & " where id_cat='"&session("cates")&"'"
end if
end if
end if
arb.open sqla,conn,3,3
nbelement=10
arb.pagesize=nbelement
IF request("page")=""then
page=1
else
if isnumeric(request("page"))then
page=cdbl(request("page"))
if page>arb.pagecount then
response.write("une erreur s'est produite")
arb.close
set titre=nothing
conn.close
set con=nothing
response.write("erreur est survenue")
response.flush
response.end
response.buffer=true
end if
else
response.write("erreur")
arb.close
set an=nothing
con.close
response.flush
response.end
end if
end if
if not(arb.bof and arb.eof) then
arb.AbsolutePage=page
end if
%>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="151" align="left" valign="top"><table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32"><form name="form1" method="post" action="">
<table width="50%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="cate" id="cate" onChange="hide.value='2';target='_self';form1.action='liste3.asp';submit()">
<option value="all" >Choisir une catégorie </option>
<% while not cate2.eof %>
<option value="<%=cate2("id_cat")%>" <% if request.form("cate")=cate2("id_cat") then
response.write(" selected")
hide2.value=cate2("cat")
end if
%> >
<% if not cate2.eof then %><%=cate2("cat")%><% end if %>
</option><%cate2.movenext
wend
%>
</select><input type="hidden" name="hide" value="0">
</td>
</tr>
</table>
</form></td>
</tr>
</table>
<p> </p>
<table width="75%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="19" colspan="3" align="left" valign="top"> </td>
</tr>
<tr>
<td height="19" align="left" valign="top">Nom</td>
<td align="left" valign="top">Prenom</td>
<td align="left" valign="top">Club</td>
</tr>
<%
if not arb.eof then
for i=1 to arb.pagesize
%>
<tr>
<td height="19" align="left" valign="top"><%=arb("nom")%></td>
<td height="19" align="left" valign="top"><%=arb("prenom")%></td>
<td height="19" align="left" valign="top"><%=arb("club")%></td>
</tr>
<%
arb.movenext
if arb.eof then exit for
next
end if%>
</table>
<%if arb.recordcount>10 then%>
<table class="texte1" width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"> </td>
<td align="left" valign="top"> </td>
<td align="center" valign="top"> </td>
<td align="right" valign="top"> </td>
<td align="center"></td>
</tr>
<tr>
<td width="3%" align="center"> </td>
<td width="33%" align="left" valign="top"><%
if page>1 then
reff="liste3.asp?page="&page-1
%>
<div align="left"><a class="lien" href="<%=reff%>">Précédente</a> </div>
<%end if%>
</td>
<td width="33%" align="center" valign="top">Page <%=page%> sur <%=arb.pagecount%></td>
<td width="33%" align="right" valign="top"><%
if page< arb.pagecount then
ref="liste3.asp?page="&page+1
%>
<div align="right"><a class="lien" href="<%=ref%>">Suivante </a></div>
<%end if%>
</td>
<td width="3%" align="center"></td>
</tr>
</table>
<%
end if%></td>
</tr>
</table>
</body>
</html>