Nel momento in cui non trova nessun record mi da errore nella pagina sulla riga in rosso...codice:<%@LANGUAGE = VBScript%> <% Dim sc, cn, rs, quanti, pag, contatore sc = "" sc = sc & "driver={Microsoft Access Driver (*.mdb)};dbq=" sc = sc & Server.MapPath("database.mdb") Set cn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") cn.Open sc quanti = 5 pag = Request.QueryString("pag") If IsNumeric(pag) = False Or pag < 1 Then pag = 1 contatore = 0 %> <html> <head> <title>Paginazione dei risultati di query molto lunghe in ASP</title> <style>a { color: blue; }</style> </head> <body> <table align="center" width="300" border="1"> <% rs.Open "SELECT nome FROM utenti ORDER BY nome ASC", cn, 1 rs.PageSize = quanti rs.AbsolutePage = pag While rs.EOF = False And contatore < quanti %> <tr><td><%=rs("nome")%></td></tr> <% rs.MoveNext contatore = contatore + 1 Wend %> </table> </body> </html> <% rs.Close Set rs = Nothing cn.Close Set cn = Nothing %> <p align="center"> <%If pag > 1 Then%> Indietro <%End If%> <% Dim x x = 1 For x = 1 To rs.PageCount If CInt(pag) <> x Then %> [<%=x%>] <% Else %> [<%=x%>] <% End If Next %> <%If rs.EOF = False Then%> Avanti <%End If%> </p>
è possibile ovviare alla cosa?

Rispondi quotando