codice:
<%
x=0
y=0
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& Server.MapPath("../db/data.mdb")
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="Select * from MiniBlog where ID_Destinatario=" & Session("ID")
rs.Open sql,Conn,3,3
do while not rs.eof
Set rs2=Server.CreateObject("ADODB.RecordSet")
sql2="Select * from Iscritti where ID=" & rs("ID_Mittente") &" order by ID desc"
rs2.Open sql2,Conn,3,3
if not rs2.eof then
y = y + 1
if x=0 then
bgCol="bgcolor='#F0F4F8'"
x=x+1
else
bgCol="bgcolor='lightyellow'"
x=0
end if
%>
<tr>
<td align="right" width="8" height="20" style="font-family: Verdana; font-size: 10 px; color: #800000; font-weight: bold" >
<p align="left"><%=y%></td>
<td align="right" <%=bgCol%> width="228" height="20">
<font size="2" face="Verdana" color="#808080">Inviato da:</font><font face="Verdana" size="2"><font color="#339933">
</font> <a href="#" onClick=openpopup('xx','<%=rs("ID")%>')>
<font color="#339933"><%=rs2("User")%></font></a></font></td>
<td align="right" <%=bgCol%> width="272" height="20">
<p align="left"> <a href="#" onClick="openpopup2('<%=rs("ID_Mittente")%>')">
<font face="Verdana" size="1" color="#FF9966">Rispondi</font></a>
<font color="#808080" size="1" face="Verdana">Data e ora:</font><font color="#0000CC" size="1" face="Verdana"> <%=rs("Data_Messaggio")%></font></td>
<td align="right" <%=bgCol%> width="19" height="20">
<p align="center"><input type="checkbox" name="letto<%=y%>" class="checkBox" value="<%=rs("ID")%>"></td>
</tr>
<%
end if
rs.movenext
%>
<%loop%>
<%end if%>