dovrei integrare questo script:
codice:<div align="center"> <table width="100%" border="0:106" cellspacing="0" style="border-left-width: 0px; border-right-width: 0px"> <% '---Dichiarazione variabili Dim SQL, RSnews, CicloNews,page, perpage,Rs,i,pag 'recupero la pagina page = Request.QueryString("page") perpage = 1 Set Conn = Server.CreateObject("ADODB.Connection") Conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/mdb-database/ecom.mdb") Set Rs = Server.CreateObject("ADODB.Recordset") SQL = " SELECT * FROM News ORDER BY ID ASC" Rs.Open sql, Conn, 1, 3 If page = "" then page = (rs.PageCount) End if Rs.PageSize = perpage Rs.AbsolutePage = page %> <tr bgcolor=""> <td width="239" style="border-bottom-style: solid; border-bottom-width: 1px"> <img border="0]<%=Path_Img%>news.jpg" width="100:80"> <td width="238" style="border-bottom-style: solid; border-bottom-width: 1px"> <%= RS("Titolo")%><tr> <td width="11" align="center" valign="top" bordercolor="#D9E7EE" style="border-left-style: none; border-left-width: medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px:73"> <%=RS("Img")%> </td> <td width="100%" valign="top" bordercolor="#D9E7EE" style="border-left-style: none; border-left-width: medium; border-right-style:none; border-right-width:medium; border-top-style:solid; border-top-width:1px:73"> <%= RS("Testo")%></td> </table></div> <% For i = 1 to perpage If Not Rs.EOF then if Rs("id") < 10 then end if Rs.MoveNext end if next %> <% Response.Write " Pagine News Presenti: " For pag= 1 to rs.PageCount if page = pag then Response.Write "" Response.Write "<A href='default.asp?page=" & pag Response.write "'>" Response.Write pag Response.Write "</A> " Response.Write "" else Response.Write "<A href='default.asp?page=" & pag Response.write "'>" Response.Write pag Response.Write "</A> " end if Next Response.Write "</P>" %> <% Rs.Close Set Rs = Nothing Conn.Close Set Conn = Nothing %>
in questa pagina asp, che così com è già mi stampa a video i record presi da una variabile MaxNews contenuta in un file include inc_variabili.asp:
praticamente integrarlo a (For CicloNews = 1 To MaxNews) dove MaxNews è = al num di record per pagina..per fare l impaginazione..chi mi da una mano a farlo o a capire come si fa?codice:<table width="480" border="0" align="center" height="344"> <% '---Dichiarazione variabili Dim SQL, RSnews, CicloNews '---Recupero le ultime News dal database e le stampo a video Set RSnews = Server.CreateObject("ADODB.RecordSet") SQL = " SELECT * FROM News ORDER BY ID DESC" RSnews.Open SQL, Conn, 1 If NOT RSNews.EOF Then For CicloNews = 1 To MaxNews If RSNews.EOF Then Exit For %> <tr bgcolor="<%=Tabella_Colore_Titolo%>"> <td colspan="2"> > <%= RSnews("Titolo") %> </td> </tr> <tr> <% If Len(RSnews("Img")) > 0 Then %> <td width="120" align="center" valign="top"> [img]<%=Path_Img%><%=RSnews([/img]" width="110" height="108" border="1"> </td> <td width="360" valign="top"> <% Else %> <td width="480" valign="top" colspan=2> <% End If %> <p align="justify"><%= RSnews("Testo") %></p> </td> </tr> <% RSnews.MoveNext Next Else %> <tr> <td align="center" valign="top" colspan="2"> <%=Errore_NoNews%> </td> </tr> <% End If RSNews.Close Set RSnews = Nothing %> </table>

Rispondi quotando