mmm....
io utilizzo questo tipo di programmazione:
codice:
<%
'---Dichiarazione variabili
Dim RSmain, CicloNews, MaxNews
'---Recupero le ultime News dal database e le stampo a video
Set RSmain = Server.CreateObject("ADODB.RecordSet")
SQL = " SELECT * FROM mainews ORDER BY IDmain DESC"
RSmain.Open SQL, Conn, 3
'Dico quante news deve visualizzare al massimo
MaxNews = 3
If NOT RSmain.EOF Then
For CicloNews = 1 To MaxNews
If RSmain.EOF Then Exit For
%>
<link href="/inc/srt.css" rel="stylesheet" type="text/css">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr bgcolor="#CC0000">
<td bgcolor="#FFCC00"><table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td bgcolor="#CC0000"><div align="center"><span class="Stile47"><%= RSmain("Titolo") %></span></div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><div align="left" class="style10">
<div align="center">
</div>
<table width="98%" border="0" align="center">
<tr>
<td width="6%"><div align="center"><B
style="mso-bidi-font-weight: normal">
<%
If Len(RSmain("Img")) > 0 Then
%>
[img]/public/<%=RSmain([/img]" width="150" height="120" border="1">
<%
Else
%>
<%
End If
%>
[/B]</div></td>
<td width="94%"> <div align="center" class="primapagina">
<span class="style10"> </span> <%= RSmain("Testo") %></div> </td>
</tr>
</table>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center">
<hr width="80%" size="1">
</div></td>
</tr>
</table>
<div align="center">
<%
RSmain.MoveNext
Next
Else
%>
<%=Errore_NoNews%></div>
<%
End If
RSmain.Close
Set RSmain = Nothing
%>