Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/05/2006, 16:30
Avatar de Boxmaster
Boxmaster
 
Fecha de Ingreso: agosto-2004
Ubicación: Ahorita... frente a mi PC
Mensajes: 74
Antigüedad: 20 años, 8 meses
Puntos: 0
estoy usando este codigo para paginar en MySql y asp pero no me funciona correctamente, alguien me puede ayudar

<body>
<br><%
'Conexion a tu base de datos
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=envelope;USER=ro ot;PASSWORD=123111;OPTION=3;")

pagina=request("pagina")
if pagina="" then
pagina="1"
end if
Cadena="select * from Production where Estado='ON' limit "&(pagina-1)*20 &",20"

Set RS = Conn.Execute(cadena)
If RS.EOF=false AND RS.BOF=false then
total = 0

cadena2="select * from production"
Set RS2 = Conn.Execute(cadena2)%>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#669966"><span class="Estilo1">Account</span></td>
<td bgcolor="#669966" class="Estilo1">Customer</td>
<td bgcolor="#669966" class="Estilo1">PO</td>
<td bgcolor="#669966" class="Estilo1">Project</td>
</tr>
<%
while not rs.eof
total= total+1
registros=RS.RecordCount%>
<tr>
<td class="Estilo2"><%=RS("Account")%></td>
<td class="Estilo2"><%=RS("Customer")%></td>
<td class="Estilo2"><%=RS("PO")%></td>
<td class="Estilo2"><%=RS("Project")%></td>
</tr>
<%rs.movenext
wend%>
</table>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#669966" class="Estilo1">Registros por p&aacute;gina: <%=Total%> - Ir a la página <a href="paginarmysql.asp?Pagina=<%=Total%>"><%=Total %></a> </td>
</tr>
</table><%rs.close
paginas = int(total/5)+1
For p = 1 To paginas
%>
<%Next%><br>
<br>
<%end if%>
<% Response.Write "ID Session = " & Session.SessionID %>
<br>
<%for each elemento in session.contents
response.write elemento & "= " & session.contents(elemento) & "<br />"
next%></body>
__________________
México no es México sin su gente, y la democracia no es de algunas personas, es de todos. Hagamos valer nuestros derechos.