Bem amigo não consegui adaptar, fica dando uns erros estranho, então estou colocando o codigo da paginação.
Eu estou precisando se puderem que fique assim: << 1, 2, 3, 4, ..., >>, quando eu clica no proximo fica << 5, 6 ,7, 8
...>>
id = request("idevento")
registros = 12
pagina = Request.QueryString("pagina")
If pagina = "" Then
pagina = 1
End If
Set rs = Server.Createobject("ADODB.RECORDSET")
set rs.ActiveConnection = Conexao
rs.CursorType = 3
rs.PageSize = registros
SQL2 = "select * from Eventos where idevento = "& id &""
set rs2 = conexao.execute(SQL2)
pasta = rs2("pasta")
rs2.close
Set rs2 = nothing
sql = "SELECT * FROM Fotos where idevento = "& id &" ORDER BY idfoto"
rs.Open sql
If rs.EOF Then
tem = "nao"
Response.Write ""
Else
rs.AbsolutePage = pagina
contador = 0
While Not rs.EOF AND x < rs.PageSize
x = x + 1
id_final = rs("idfoto")
rs.MOveNext
Wend
for w = 1 to x
rs.MovePrevious
Next
x = 0
While Not rs.EOF AND x < rs.PageSize
x = x + 1
if cint(x) = 1 Then
idf = rs("idfoto")
id_inicial = idf
end if
if contador = 3 Then
response.write "<br><br><br><br><br>"
contador = 1
else
contador = contador + 1
end if
%>
<%
%>
<table border="0" width="107" cellspacing="0" cellpadding="0" align="left" height="75" style="border-width:0; border-top-color:rgb(0,0,0); border-right-color:rgb(0,0,0); border-bottom-color:rgb(0,0,0); border-style:none;">
<tr>
<td width="100" height="75" style="border-width:0px; border-top-color:rgb(0,0,0); border-right-color:rgb(0,0,0); border-bottom-color:rgb(0,0,0); border-style:none;">
<a href='../coberturas/mostrar_foto.asp?idfoto=<%=rs("idfoto")%>&idevento=<%=id%>&id_inicial=<%=id_inicial%>&id_final=<%=id_final%>' target="mostrar_foto"><img border="1" src=fotos/<%=pasta%>/miniaturas/<%=rs("foto")%> style="filter:alpha(opacity=50)" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)" width=100 height=75 alt="Número da foto para comprar: <%=rs("idfoto")%>"></a>
</td>
<td width="5" height="75"></td>
</tr>
</table>
<%
rs.MoveNext
Wend
select case x
case 1, 2,3
response.write "<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>"
case 4, 5, 6
response.write "<br><br><br><br><br><br><br><br><br><br><br><br><br>"
case 7, 8, 9
response.write "<br><br><br><br><br><br><br><br>"
case 10, 11, 12
response.write "<br><br><br>"
end select
%> </td>
</tr>
<tr>
<td width="403"> <table align="left" border="0" cellpadding="0" cellspacing="0" width="367">
<tr valign="middle">
<td height="118">
<table width="103%" align="center">
<tr>
<td><font color="#000000" face="tahoma"><span style="font-size:10pt;"><b>
<%
<---- Paginação Aqui --->>>>
total = rs.PageCount
for i = 1 to total
if i = cInt(pagina) Then
response.write "<table width=25 height=25 align=left>"&i&"<table>"
else
response.write "<table width=25 height=25 align=left>"
response.write "<font color=""#FFFFFF"" size=""-2""><a href=galeria.asp?idevento="&id&"&pagina="&i&">"&i&"</a></font>"
response.write "</table>"
end if
Next
end if
rs.Close
Set rs = Nothing
%>