salut, voila j'utilise databasemanager pour gerer une base de donnée le probleme c que ma base est tres grosse et donc il faut que je limite le nb d'affichage... J'ai trouvé un exemple de pagination sur asp-php.net mais dans mon cas c des recordset et j'arrive pas a l'appliquer
<!-- #INCLUDE FILE="includes/common.asp" --> <%
dim DB_CONNECTIONSTRING,dejapasse,tri,date_du_delai const adSchemaTables=20
if Request.Cookies ("YNIZON" )("DB_VERSION" ) = "2000" then DB_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" ) else DB_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" ) end if if DB_CONNECTIONSTRING="" then response.redirect ("./default.asp" )
'Creation de la connexion dim cnx set cnx = server.CreateObject ("ADODB.connection" ) cnx.Open request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" ),request.cookies ("YNIZON" )("USER_DB" ),request.cookies ("YNIZON" )("PASS_DB" )
'Creation des recordsets dim rs1,rs2,sql1,sql2,sql3,i,X_table,X_cle set rs1 = server.CreateObject ("ADODB.recordset" ) set rs2 = server.CreateObject ("ADODB.recordset" )
'Detection de la table X_table = request.querystring("seltable" ) if X_table="" then rs2.open cnx.OpenSchema (20) dejapasse=0 do while not rs2.eof if rs2(3)="TABLE" and dejapasse=0 then X_Table = rs2(2) rs2.movelast dejapasse=1 else rs2.movenext end if loop rs2.close end if
'Gestion du tri 'On inverse la methode de tri si elle est cliquee 2 fois
tri=request.querystring("tri" ) if tri=request.cookies("YNIZON" )("TRI" ) then sql1="select * from " & X_Table & " order by " & tri & " ASC;" response.cookies ("YNIZON" )("TYPE_TRI" ) = "ASC" else sql1="select * from " & X_Table & " order by " & tri & " DESC;" response.cookies ("YNIZON" )("TYPE_TRI" ) = "DESC" end if
if request.querystring("tri" )="" then tri="DEFAUT" sql1="select * from " & X_Table end if response.cookies ("YNIZON" )("TRI" ) = TRI
do while not rs2.eof if rs2(3)="TABLE" then if request.querystring("seltable" ) = rs2(2) then response.write ("<option selected>" & rs2(2) &"</option>" ) else response.write ("<option>" & rs2(2) &"</option>" ) end if if dejapasse=0 and X_table="" then X_Table=rs2(2) dejapasse=1 end if rs2.movenext loop rs2.close %> </select> <input type=submit name=changer value="CHANGER DE TABLE"> </form></p>
<p><hr><FONT color=#1a1070 face="Arial, Helvetica, sans-serif" size=2><B>Ajout d'un enregistrement:</B></FONT><BR>
<IMG height=2 src="images/dot2.gif" width=170><BR> <form action=traitementENR1.asp?mode=ADD method=post name=ADD> <% response.write "<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>" ' affichage des nom de champs for i=0 to rs1.Fields.count-1 if UCASE(right(rs1.fields(i).name,2))="ID" then response.write "<th><font color=#cc0000>" & rs1.fields(i).name &"</th>" else response.write "<th>" & rs1.fields(i).name &"</th>" end if next response.write "</tr>" ' affichage des valeurs response.write "<tr>" for i=0 to rs1.Fields.count-1 if ucase(right(rs1.fields(i).name,2))="ID" then if rs1.fields(i).type=11 then response.write "<td><select name=add" & i & "><option>True</option><option>False</option></select></td>" else response.write "<td><input name=add" & i & "></td>" end if X_cle=rs1.fields(i).name else if rs1.fields(i).type=201 then response.write "<td><textarea style=HEIGHT:" & NBC_H & "px;WIDTH:" & NBC_L & "px name=add" & i & "></textarea></td>" elseif rs1.fields(i).type=135 then if Request.cookies ("YNIZON" )("LANGUE_SERVEUR" ) = "US" then date_du_delai=ChangeDate(date) else date_du_delai=date end if response.write "<td><input size=" & NBC_D & " name=add" & i & " value=" & date_du_delai & "></td>" elseif rs1.fields(i).type=11 then response.write "<td><select name=add" & i & " size=1><option>True</option><option>False</option></select></td>" elseif rs1.fields(i).type=3 then response.write "<td><input size=" & NBC_N & " name=add" & i & " value=0></td>" else response.write "<td><input name=add" & i & "></td>" end if end if next response.write "</tr>" response.write "</TABLE><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_cle type=hidden value=" & x_cle & "><input name=X_Table type=hidden value=" & X_Table & ">" %> <br> <input type=submit name=ADD value=AJOUTER> </form><p><hr> <font color=#1a1070 face="Arial, Helvetica, sans-serif" size=2><b>Effacement d' enregistrement(s):</b></font><br> <IMG height=2 src="images/dot2.gif" width=210></p>
<% 'On verifie que le champ ne soit pas vide if rs1.RecordCount<>0 then rs1.movefirst 'Il faut selectionner les champs qui ne sont pas en memo 'Puis on genere la requete SQL2 qui nous permet d afficher toutes les infos dans des ListBox response.write ("<form name=DEL method=post action=traitementENR1.asp?mode=DEL>" ) response.write ("<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>" ) for i=0 to rs1.fields.count-1 'On affiche tous les champs qui ne sont pas en memo if rs1.fields(i).type<>"201" then if UCASE(right(rs1.fields(i).name,2))="ID" then response.write ("<td><b><center><font color=#cc0000>" & rs1(i).name & "</center></b></td>" ) else response.write ("<td><b><center>" & rs1(i).name & "</center></b></td>" ) end if end if next response.write ("</tr>" ) for i=0 to rs1.fields.count-1 if rs1.fields(i).type<>"201" then sql2="select DISTINCT " & rs1(i).name & " from " & X_Table & " order by " & rs1(i).name rs2.open SQL2, cnx,adLockOptimistic, adOpenDynamic response.write ("<td><select size=1 name=eff"& i &"><option selected></option>" ) do while not rs2.eof if rs2(0)="Vrai" then response.write ("<option>True</option>" ) elseif rs2(0)="Faux" then response.write ("<option>False</option>" ) else response.write ("<option>" & rs2(0) & "</option>" ) end if rs2.movenext loop response.write ("</select></td>" ) rs2.close end if next response.write "</tr></table>" response.write ("<br><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_Table type=hidden value=" & X_Table & "><input type=submit name=DEL value=EFFACER></form>" ) %> <p><hr> <font color=#1a1070 face="Arial, Helvetica, sans-serif" size=2><b>Mise a jour d'enregistrement(s):</b></font><br> <IMG height=2 src="images/dot2.gif" width=210></p> <% 'On verifie que le champ ne soit pas vide if rs1.RecordCount<>0 then rs1.movefirst 'Il faut selectionner les champs qui ne sont pas en memo 'Puis on genere la requete SQL2 qui nous permet d afficher toutes les infos dans des ListBox response.write ("<form name=UPDSPE method=post action=traitementENR1.asp?mode=UPDSPE>" ) response.write ("<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr><td></td>" ) for i=0 to rs1.fields.count-1 'On affiche tous les champs qui ne sont pas en memo 'Detection des cles primaires if rs1.fields(i).type<>"201" then if right(rs1.fields(i).name,2) = "ID" then response.write ("<td><b><center><font color=#cc0000>" & rs1(i).name & "</center></b></td>" ) else response.write ("<td><b><center>" & rs1(i).name & "</center></b></td>" ) end if end if next response.write ("</tr><td>DE</td>" ) for i=0 to rs1.fields.count-1 if rs1.fields(i).type<>"201" then sql2="select DISTINCT " & rs1(i).name & " from " & X_Table & " order by " & rs1(i).name rs2.open SQL2, cnx,adLockOptimistic, adOpenDynamic response.write ("<td><select size=1 name=de"& i &"><option selected></option>" ) do while not rs2.eof if rs2(0)="Vrai" and rs1.fields(i).type=11 then response.write ("<option>True</option>" ) elseif rs2(0)="Faux" and rs1.fields(i).type=11 then response.write ("<option>False</option>" ) else response.write ("<option>" & rs2(0) & "</option>" ) end if rs2.movenext loop response.write ("</select></td>" ) rs2.close end if next response.write "</tr><tr><td>EN</td>" for i=0 to rs1.fields.count-1 if rs1.fields(i).type<>"201" then if rs1.fields(i).type=135 then response.write ("<td><input size=" & NBC_D & " name=en"& i &"></td>" ) if rs1.fields(i).type=3 then response.write ("<td><input size=" & NBC_N & " name=en"& i &"></td>" ) if rs1.fields(i).type=11 then response.write ("<td><select size=1 name=en"& i &"><option></option><option>True</option><option>False</option></select></td>" ) if rs1.fields(i).type<>3 and rs1.fields(i).type<>11 and rs1.fields(i).type<>135 then response.write ("<td><input name=en"& i &"></td>" ) end if
<p><hr><font color=#1a1070 face="Arial, Helvetica, sans-serif" size=2><b>Requête SQL:</b></font><br> <IMG height=2 src="images/dot2.gif" width=90></p> <form name="sql" method=post action=traitementENR1.asp?mode=SQL> <font face="Georgia, Times New Roman, Times, serif"><b>SQL:</b></font> <input type="text" name="sql1" size="75"><br><br><input type=submit name=submit value="LANCER"> </form><p><hr> <font color=#1a1070 face="Arial, Helvetica, sans-serif" size=2><b>Liste des <% = rs1.recordcount %> enregistrements (tri par <% =tri %> ):</b></font><br> <IMG height=2 src="images/dot2.gif" width=280><br> </p> <% if rs1.recordcount<>0 then rs1.movefirst response.write "<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>" ' affichage des nom de champs for i=0 to rs1.Fields.count-1 if rs1.fields(i).type =201 then response.write "<th>" & rs1.fields(i).Name & "</th>" else response.write "<th><a href=modifENR1.asp?seltable=" & X_table & "&tri="& rs1.fields(i).name & ">" & rs1.fields(i).Name & "</a></th>" end if next response.write ("<td><b>Mise a jour</b></font></td></tr>" ) ' affichage des valeurs (on creer un formulaire par ligne avec la cle primaire en texte cachee)
do while not rs1.eof response.write "<tr><form name=UPD method=post action=traitementENR1.asp?mode=UPD>" for i=0 to rs1.Fields.count-1 if ucase(right(rs1.fields(i).name,2)="ID" ) then X_cle=rs1.fields(i).name if rs1.fields(i).type=11 and rs1.fields(i).value="Vrai" then response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=True></td>" ) elseif rs1.fields(i).type=11 and rs1.fields(i).value="Faux" then response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=False></td>" ) else response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" ) end if else if rs1.fields(i).type =201 then response.write ("<td><textarea style=HEIGHT:" & NBC_H & "px;WIDTH:" & NBC_L & "px name=UPD" & i & ">" & rs1.fields(i).value & "</textarea></td>" ) elseif rs1.fields(i).type =11 then response.write ("<td><select size=1 name=UPD" & i & ">" ) if rs1.fields(i).value ="Vrai" then response.write ("<option selected>True</option><option>False</option></select></td>" ) else response.write ("<option>True</option><option selected>False</option></select></td>" ) end if elseif rs1.fields(i).type =3 then response.write ("<td><input type=hidden name=exnomchamp" & i & " value=" & rs1.Fields(i).value &"><input size=" & NBC_N & " name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" ) elseif rs1.fields(i).type =135 then response.write ("<td><input type=hidden name=exnomchamp" & i & " value=" & rs1.Fields(i).value &"><input size=" & NBC_D & " name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" ) else response.write ("<td><input name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" ) end if end if next rs1.movenext response.write ("<td><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_cle type=hidden value=" & x_cle & "><input name=X_Table type=hidden value=" & X_Table & "><center><input type=submit name=UPD value=MAJ></td></form></tr>" ) loop response.write "</TABLE>" rs1.close
Marsh Posté le 28-07-2005 à 11:38:39
salut,
voila j'utilise databasemanager pour gerer une base de donnée
le probleme c que ma base est tres grosse et donc il faut que je limite le nb d'affichage...
J'ai trouvé un exemple de pagination sur asp-php.net mais dans mon cas c des recordset et j'arrive pas a l'appliquer
<!-- #INCLUDE FILE="includes/common.asp" -->
<%
dim DB_CONNECTIONSTRING,dejapasse,tri,date_du_delai
const adSchemaTables=20
if Request.Cookies ("YNIZON" )("DB_VERSION" ) = "2000" then
DB_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" )
else
DB_CONNECTIONSTRING = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" )
end if
if DB_CONNECTIONSTRING="" then response.redirect ("./default.asp" )
'Creation de la connexion
dim cnx
set cnx = server.CreateObject ("ADODB.connection" )
cnx.Open request.cookies ("YNIZON" )("DB_CONNECTIONSTRING" ),request.cookies ("YNIZON" )("USER_DB" ),request.cookies ("YNIZON" )("PASS_DB" )
'Creation des recordsets
dim rs1,rs2,sql1,sql2,sql3,i,X_table,X_cle
set rs1 = server.CreateObject ("ADODB.recordset" )
set rs2 = server.CreateObject ("ADODB.recordset" )
'Detection de la table
X_table = request.querystring("seltable" )
if X_table="" then
rs2.open cnx.OpenSchema (20)
dejapasse=0
do while not rs2.eof
if rs2(3)="TABLE" and dejapasse=0 then
X_Table = rs2(2)
rs2.movelast
dejapasse=1
else
rs2.movenext
end if
loop
rs2.close
end if
'Gestion du tri
'On inverse la methode de tri si elle est cliquee 2 fois
tri=request.querystring("tri" )
if tri=request.cookies("YNIZON" )("TRI" ) then
sql1="select * from " & X_Table & " order by " & tri & " ASC;"
response.cookies ("YNIZON" )("TYPE_TRI" ) = "ASC"
else
sql1="select * from " & X_Table & " order by " & tri & " DESC;"
response.cookies ("YNIZON" )("TYPE_TRI" ) = "DESC"
end if
if request.querystring("tri" )="" then
tri="DEFAUT"
sql1="select * from " & X_Table
end if
response.cookies ("YNIZON" )("TRI" ) = TRI
rs1.open SQL1, cnx, adLockOptimistic, adOpenDynamic
rs2.open cnx.OpenSchema (20)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>DataBase Manager</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff link=#990000 vLink=#990000>
<CENTER>
<TABLE border=0 cellPadding=3 cellSpacing=1 width=775>
<TBODY>
<TR bgColor=#1c127b borderColor=#cccccc vAlign=center>
<TD colSpan=2 height=50><FONT color=#ffffff
face="Arial, Helvetica, sans-serif" size=5><I><B>DataBase Manager v<% =numeroversion & " (" & request.cookies("YNIZON" )("MODE_CONNECTION" )%> )</B></I></FONT></TD>
</TR>
<TR bgColor=#bec2d4 borderColor=#cccccc vAlign=center>
<TD width=645>
<DIV align=left><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=2><B>Modification des Enregistrements de la table <%=X_Table %></B></FONT></DIV>
</TD>
<TD width=173>
<DIV align=right><FONT color=#cc0000
face="Verdana, Arial, Helvetica, sans-serif" size=1><B><A
href="USERMAN1.asp">ADMIN</A> | <A
href="modifTAB1.asp">TABLES</A> | <A
href="modifCHA1.asp?seltable=<% =x_table %>">CHAMPS</A></B></FONT></DIV></TD></TR></TBODY></TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=775>
<TBODY>
<TR>
<TD> </TD>
<TD width=20> </TD>
<TD width=415> </TD>
<TD colspan="2" rowspan="3"> </TD>
</TR>
<TR>
<TD vAlign=top colspan="3" rowspan="2">
<p><hr><FONT color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><B>Selection de la table:</B></FONT><BR>
<IMG height=2 src="images/dot2.gif"
width=140><BR></p>
<form name=seltable method=get action=modifENR1.asp>
<select size=1 name=seltable>
<%
dejapasse=0
do while not rs2.eof
if rs2(3)="TABLE" then
if request.querystring("seltable" ) = rs2(2) then
response.write ("<option selected>" & rs2(2) &"</option>" )
else
response.write ("<option>" & rs2(2) &"</option>" )
end if
if dejapasse=0 and X_table="" then X_Table=rs2(2)
dejapasse=1
end if
rs2.movenext
loop
rs2.close
%>
</select>
<input type=submit name=changer value="CHANGER DE TABLE">
</form></p>
<p><hr><FONT color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><B>Ajout d'un enregistrement:</B></FONT><BR>
<IMG height=2 src="images/dot2.gif"
width=170><BR>
<form action=traitementENR1.asp?mode=ADD method=post name=ADD>
<%
response.write "<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>"
' affichage des nom de champs
for i=0 to rs1.Fields.count-1
if UCASE(right(rs1.fields(i).name,2))="ID" then
response.write "<th><font color=#cc0000>" & rs1.fields(i).name &"</th>"
else
response.write "<th>" & rs1.fields(i).name &"</th>"
end if
next
response.write "</tr>"
' affichage des valeurs
response.write "<tr>"
for i=0 to rs1.Fields.count-1
if ucase(right(rs1.fields(i).name,2))="ID" then
if rs1.fields(i).type=11 then
response.write "<td><select name=add" & i & "><option>True</option><option>False</option></select></td>"
else
response.write "<td><input name=add" & i & "></td>"
end if
X_cle=rs1.fields(i).name
else
if rs1.fields(i).type=201 then
response.write "<td><textarea style=HEIGHT:" & NBC_H & "px;WIDTH:" & NBC_L & "px name=add" & i & "></textarea></td>"
elseif rs1.fields(i).type=135 then
if Request.cookies ("YNIZON" )("LANGUE_SERVEUR" ) = "US" then
date_du_delai=ChangeDate(date)
else
date_du_delai=date
end if
response.write "<td><input size=" & NBC_D & " name=add" & i & " value=" & date_du_delai & "></td>"
elseif rs1.fields(i).type=11 then
response.write "<td><select name=add" & i & " size=1><option>True</option><option>False</option></select></td>"
elseif rs1.fields(i).type=3 then
response.write "<td><input size=" & NBC_N & " name=add" & i & " value=0></td>"
else
response.write "<td><input name=add" & i & "></td>"
end if
end if
next
response.write "</tr>"
response.write "</TABLE><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_cle type=hidden value=" & x_cle & "><input name=X_Table type=hidden value=" & X_Table & ">"
%> <br>
<input type=submit name=ADD value=AJOUTER>
</form><p><hr>
<font color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><b>Effacement d' enregistrement(s):</b></font><br>
<IMG height=2 src="images/dot2.gif" width=210></p>
<%
'On verifie que le champ ne soit pas vide
if rs1.RecordCount<>0 then rs1.movefirst
'Il faut selectionner les champs qui ne sont pas en memo
'Puis on genere la requete SQL2 qui nous permet d afficher toutes les infos dans des ListBox
response.write ("<form name=DEL method=post action=traitementENR1.asp?mode=DEL>" )
response.write ("<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>" )
for i=0 to rs1.fields.count-1
'On affiche tous les champs qui ne sont pas en memo
if rs1.fields(i).type<>"201" then
if UCASE(right(rs1.fields(i).name,2))="ID" then
response.write ("<td><b><center><font color=#cc0000>" & rs1(i).name & "</center></b></td>" )
else
response.write ("<td><b><center>" & rs1(i).name & "</center></b></td>" )
end if
end if
next
response.write ("</tr>" )
for i=0 to rs1.fields.count-1
if rs1.fields(i).type<>"201" then
sql2="select DISTINCT " & rs1(i).name & " from " & X_Table & " order by " & rs1(i).name
rs2.open SQL2, cnx,adLockOptimistic, adOpenDynamic
response.write ("<td><select size=1 name=eff"& i &"><option selected></option>" )
do while not rs2.eof
if rs2(0)="Vrai" then
response.write ("<option>True</option>" )
elseif rs2(0)="Faux" then
response.write ("<option>False</option>" )
else
response.write ("<option>" & rs2(0) & "</option>" )
end if
rs2.movenext
loop
response.write ("</select></td>" )
rs2.close
end if
next
response.write "</tr></table>"
response.write ("<br><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_Table type=hidden value=" & X_Table & "><input type=submit name=DEL value=EFFACER></form>" )
%>
<p><hr>
<font color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><b>Mise a jour d'enregistrement(s):</b></font><br>
<IMG height=2 src="images/dot2.gif" width=210></p>
<%
'On verifie que le champ ne soit pas vide
if rs1.RecordCount<>0 then rs1.movefirst
'Il faut selectionner les champs qui ne sont pas en memo
'Puis on genere la requete SQL2 qui nous permet d afficher toutes les infos dans des ListBox
response.write ("<form name=UPDSPE method=post action=traitementENR1.asp?mode=UPDSPE>" )
response.write ("<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr><td></td>" )
for i=0 to rs1.fields.count-1
'On affiche tous les champs qui ne sont pas en memo
'Detection des cles primaires
if rs1.fields(i).type<>"201" then
if right(rs1.fields(i).name,2) = "ID" then
response.write ("<td><b><center><font color=#cc0000>" & rs1(i).name & "</center></b></td>" )
else
response.write ("<td><b><center>" & rs1(i).name & "</center></b></td>" )
end if
end if
next
response.write ("</tr><td>DE</td>" )
for i=0 to rs1.fields.count-1
if rs1.fields(i).type<>"201" then
sql2="select DISTINCT " & rs1(i).name & " from " & X_Table & " order by " & rs1(i).name
rs2.open SQL2, cnx,adLockOptimistic, adOpenDynamic
response.write ("<td><select size=1 name=de"& i &"><option selected></option>" )
do while not rs2.eof
if rs2(0)="Vrai" and rs1.fields(i).type=11 then
response.write ("<option>True</option>" )
elseif rs2(0)="Faux" and rs1.fields(i).type=11 then response.write ("<option>False</option>" )
else
response.write ("<option>" & rs2(0) & "</option>" )
end if
rs2.movenext
loop
response.write ("</select></td>" )
rs2.close
end if
next
response.write "</tr><tr><td>EN</td>"
for i=0 to rs1.fields.count-1
if rs1.fields(i).type<>"201" then
if rs1.fields(i).type=135 then response.write ("<td><input size=" & NBC_D & " name=en"& i &"></td>" )
if rs1.fields(i).type=3 then response.write ("<td><input size=" & NBC_N & " name=en"& i &"></td>" )
if rs1.fields(i).type=11 then response.write ("<td><select size=1 name=en"& i &"><option></option><option>True</option><option>False</option></select></td>" )
if rs1.fields(i).type<>3 and rs1.fields(i).type<>11 and rs1.fields(i).type<>135 then response.write ("<td><input name=en"& i &"></td>" )
end if
next
response.write "</tr></table>"
response.write ("<br><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_Table type=hidden value=" & X_Table & "><input type=submit name=DEL value=""METTRE A JOUR""></form>" )
%>
<p><hr><font color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><b>Requête SQL:</b></font><br>
<IMG height=2 src="images/dot2.gif" width=90></p>
<form name="sql" method=post action=traitementENR1.asp?mode=SQL>
<font face="Georgia, Times New Roman, Times, serif"><b>SQL:</b></font>
<input type="text" name="sql1" size="75"><br><br><input type=submit name=submit value="LANCER">
</form><p><hr>
<font color=#1a1070
face="Arial, Helvetica, sans-serif" size=2><b>Liste des <% = rs1.recordcount %>
enregistrements (tri par <% =tri %> ):</b></font><br>
<IMG height=2 src="images/dot2.gif"
width=280><br>
</p>
<%
if rs1.recordcount<>0 then rs1.movefirst
response.write "<table border=1 bordercolor=#AAAAC9 cellpadding=2 cellspacing=0 style=""font-size:10pt""><tr>"
' affichage des nom de champs
for i=0 to rs1.Fields.count-1
if rs1.fields(i).type =201 then
response.write "<th>" & rs1.fields(i).Name & "</th>"
else
response.write "<th><a href=modifENR1.asp?seltable=" & X_table & "&tri="& rs1.fields(i).name & ">" & rs1.fields(i).Name & "</a></th>"
end if
next
response.write ("<td><b>Mise a jour</b></font></td></tr>" )
' affichage des valeurs (on creer un formulaire par ligne avec la cle primaire en texte cachee)
do while not rs1.eof
response.write "<tr><form name=UPD method=post action=traitementENR1.asp?mode=UPD>"
for i=0 to rs1.Fields.count-1
if ucase(right(rs1.fields(i).name,2)="ID" ) then
X_cle=rs1.fields(i).name
if rs1.fields(i).type=11 and rs1.fields(i).value="Vrai" then
response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=True></td>" )
elseif rs1.fields(i).type=11 and rs1.fields(i).value="Faux" then
response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=False></td>" )
else
response.write ("<td><center>" & rs1.fields(i).value & "<input type=hidden name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" )
end if
else
if rs1.fields(i).type =201 then
response.write ("<td><textarea style=HEIGHT:" & NBC_H & "px;WIDTH:" & NBC_L & "px name=UPD" & i & ">" & rs1.fields(i).value & "</textarea></td>" )
elseif rs1.fields(i).type =11 then
response.write ("<td><select size=1 name=UPD" & i & ">" )
if rs1.fields(i).value ="Vrai" then
response.write ("<option selected>True</option><option>False</option></select></td>" )
else
response.write ("<option>True</option><option selected>False</option></select></td>" )
end if
elseif rs1.fields(i).type =3 then response.write ("<td><input type=hidden name=exnomchamp" & i & " value=" & rs1.Fields(i).value &"><input size=" & NBC_N & " name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" )
elseif rs1.fields(i).type =135 then response.write ("<td><input type=hidden name=exnomchamp" & i & " value=" & rs1.Fields(i).value &"><input size=" & NBC_D & " name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" )
else
response.write ("<td><input name=UPD" & i & " value=""" & rs1.fields(i).value & """></td>" )
end if
end if
next
rs1.movenext
response.write ("<td><input name=compteur type=hidden value=" & rs1.fields.count-1 & "><input name=X_cle type=hidden value=" & x_cle & "><input name=X_Table type=hidden value=" & X_Table & "><center><input type=submit name=UPD value=MAJ></td></form></tr>" )
loop
response.write "</TABLE>"
rs1.close
set rs1=nothing
set rs2=nothing
set cnx=nothing
%>
<p> </p>
</TD>
</TR>
<TR> </TR>
<TR>
<TD colSpan=5>
<IMG height=1 src="images/dot1.gif"
width=774><BR>
<FONT color=#333333 face="Arial, Helvetica, sans-serif"
size=-3>Copyright © 2000, <A href="mailto:ynizon@free.fr">NIZON
Yohann</A> - <a href=http://www.ynizon.com>WWW</a> - <a href=help/help_ENR.asp target=aide>AIDE</A></FONT>
</TD>
</TR>
</TBODY>
</TABLE>
</CENTER><BR></BODY></HTML>
quelqu'un peut il me dire comment faire?
Message édité par waouzzaaa le 28-07-2005 à 12:07:05