<%@language=vbscript%> <%option explicit%> Sfondi per desktop di Sorrento


<% 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 "" 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 "
" Response.write "" Response.write "
" 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 "" 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 "
" Response.write "" Response.write "
" Response.write "
" Pagine Response.write "
" objRs.Close Set objRs=Nothing objConn.Close Set objConn=nothing %>
<% Sub CalcolaGiorno (Giorno) select case Giorno case 1 strGiorno="domenica" case 2 strGiorno="lunedi" case 3 strGiorno="martedi" case 4 strGiorno="mercoledi" case 5 strGiorno="giovedi" case 6 strGiorno="venerdi" case 7 strGiorno="sabato" End select End sub Sub Pagine TotPage = Fix (Tot\PerPagina) Resto = Tot mod PerPagina If Resto <> 0 then TotPage = Totpage + 1 End If Num = Fix(NumPage) Response.write "" Response.write "" For i = 1 to TotPage If i = Num then Response.write "" Else Response.write "" End if Next Response.write "
Pagina" & _ I & "" & _ I & "
" End sub %>