Ho un problema da risolvere. Ho un database impostato così:
id, data, b1, b2, b3, b4, b5, ecc...
Riguarda il lotto quindi ci sono, nel database, 52 colonne.
Io vorrei far visualizzare in una pagina asp solo le ultime estrazioni (ovviamente la prima colonna è l'id, l'ultima estrazione ha l'id più alto). Questo è il mio script:
<html>
<head>
<link rel="stylesheet" href="../css/link.css" type="text/css">
<title>.:: Vecchi Giochi Nuovi - Ultime Estrazioni ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<center>
<TABLE border="1" width="345" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0" height="126">
<TR bgcolor="#000000">
<TD width="741" height="1" colspan="7" background="../immagini/erba_sfondo1.jpg">
<p align="center">
<span style="font-size: 14pt">LOTTO NAZIONALE</span>
</TD>
</TR>
<TR bgcolor="#000000">
<TD width="114" height="53" bgcolor="#6A9B75">
<p align="left" style="margin-left: 5"><font color="#FFFFFF">Ruote</font></TD>
<TD width="114" height="53" bgcolor="#6A9B75" colspan="5"><center>
<font color="#FFFFFF">Estrazione del
</font></center></TD>
<TD width="115" height="53" bgcolor="#6A9B75"><center><font color="#FFFFFF">
Estrazione del
</font></center></TD>
</TR>
<%
dim strCode
strCode="innovatel"
dim intVolta
intVolta="0"
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("/fpdb/lotto.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn
sql = "SELECT * FROM estrazioni"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3
do while not(rs.eof)
if intVolta="1" then
intVolta="0"
intTesto="#000000"
intSfondo="#FFFFFF"
else
intVolta="1"
intTesto="#000000"
intSfondo="#CAE8D6"
end if
%>
<TR bgcolor="<%=intSfondo%>">
<TD width="114" height="31" align="left"><p align="left" style="margin-left: 5"><%=rs(1)%></p></TD>
<TD width="23" height="31" align="center"><%=rs(2)%></TD>
<TD width="23" height="31" align="center"><%=rs(3)%></TD>
<TD width="23" height="31" align="center"><%=rs(4)%></TD>
<TD width="23" height="31" align="center"><%=rs(5)%></TD>
<TD width="22" height="31" align="center"><%=rs(6)%></TD>
</TR>
<%
rs.movenext
loop
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
%>
</TABLE>
</center>
</body>
</html>

Rispondi quotando