<%
Dim objConn, objRS, PerPagina, NumPage, Fine, TotPage, Tot, Resto, Num, K, Inizio, I, ContaRecord
Set objConn = server.CreateObject ("ADODB.Connection")
objConn.connectionString = "driver={Microsoft Access Driver (*.mdb)};dbq="&_
server.MapPath("/mdb-database/surrentum.mdb")
objConn.Open
Set objRs= server.CreateObject ("ADODB.Recordset")
objRs.Open "sfondi", objConn, , , adCmdTable
objRS.movefirst: I = 0
Do until objRS.EOF
I = I +1: objRs.MoveNext
Loop
Tot = I
PerPagina=18
If Request.QueryString("page") = "" then
NumPage = 1
Else
NumPage = Request.QueryString("page")
End If
If NumPage=1 then
Fine = PerPagina
objrs.movefirst
K = 0: ContaRecord = 0
Response.write "
"
Do While (Not objRS.EOF) and (K <= fine-1)
ContaRecord = ContaRecord + 1
If ContaRecord = 1 then
Response.Write ""
End if
Response.write "| "
Response.write " | "
If ContaRecord mod 3 = 0 Then
Response.write "
"
ContaRecord = 0
End If
K = K + 1
objRS.movenext
Loop
Else
Inizio = (NumPage-1) * PerPagina +1: Fine = Inizio + PerPagina
K = 0: ContaRecord = 0
objRS.MoveFirst
Response.write ""
If Not ObjRS.EOF then
Do While Not (objRs.EOF)
K = K +1
If K = Inizio then
I = Inizio
If Not ObjRS.EOF then
Do While Not (objRS.EOF) or (i = fine)
If i < fine then
ContaRecord = ContaRecord + 1
If ContaRecord = 1 then
Response.Write ""
End if
Response.write "| "
Response.write " | "
If ContaRecord mod 3 = 0 Then
Response.write "
"
ContaRecord = 0
End If
End If
I = I + 1
If Not ObjRs.EOF then
objRs.MoveNext
End If
Loop
End If
End If
If Not ObjRs.EOF then
ObjRs.MoveNext
End If
Loop
End If
End If
Response.write "| "
Pagine
Response.write " |
"
objRs.Close
Set objRs=Nothing
objConn.Close
Set objConn=nothing
%>