Hola Gente, ahora resulta que tngo una pagina que despliega todos los items en una base de datos, y al final quiero que divida en paginas el resultado y poder ir a pagina 2,3 etc.
Lo hago pero mal, ayudenme porfa a encontrar el problem.
Esta es la pagina que despliega los items:
<%
Dim iPageSize
Dim iPageCount
Dim iPageCurrent
Dim strOrderBy
Dim SQL
Dim iRecordsShown
Dim I
iCatID = Request.Querystring("CatID")
OpenDBConn
iPageSize = 10
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
Call DoPageHeader
Set GobjConnect = server.createobject("ADODB.Connection")
GobjConnect.open gsConnect
Set objPagingRS = Server.CreateObject("ADODB.Recordset")
objPagingRS.CursorLocation = adUseClient
objPagingRS.PageSize = iPageSize
gsSQL = ""
gsSQL = gsSQL & "SELECT * FROM Auctions WHERE CategoryID = " & SQLVal(iCatID) & " "
gsSQL = gsSQL & " AND AvailDate <= " & SQLDate(NOW)
gsSQL = gsSQL & " And Ended = false "
gsSQL = gsSQL & " ORDER BY CloseDate "
objPagingRS.Open gsSQL, GobjConnect, adOpenStatic, adLockReadOnly, adCmdText
tSQL = ""
tSQL = tSQL & "SELECT ID, CategoryName FROM Categories WHERE ID = " & SQLVal(iCatID)
Set Categoryrs = GobjConnect.Execute(tSQL)
iPageCount = objPagingRS.PageCount
If 1 > iPageCurrent Then iPageCurrent = 1
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
Response.Write("<FONT FACE =" & chr(34) & sFont & chr(34) & ">")
Response.Write("<P><CENTER><BI G><BIG>" & Categoryrs.Fields("CategoryName") & "</CENTER><P>")
Response.Write("<TD><SMALL><B& gt;Title</B></SMALL></TD>")
objPagingRS.AbsolutePage = iPageCurrent
iswitch = TRUE
Do While objPagingRS.AbsolutePage = iPageCurrent And Not objPagingRS.EOF
If iswitch = TRUE then
scolor = "#E9E9E9"
iswitch = False
Else scolor = "#FFFFFF"
iswitch = TRUE
End If
%>
Sigue...