aggiorna.asp (dove c'è l'elenco news)
codice:
<%
oRst.Open "SELECT * FROM foto ORDER BY Data DESC;", oConn, adOpenForwardOnly, adLockReadOnly
While not oRst.Eof
%>
<tr>
<td height="23" width="81" bgcolor="#CCCCFF" class="testo"></td>
<td width="278" bgcolor="#CCCCFF" class="testo">"><%=oRst("Titolo").Value%></td>
<td width="37" height="23" bgcolor="#CCCCFF">
<div align="center"><a href="../news/aggiorna.asp?tipo=del&id=<%=oRst("ID").Value%>">
[img]del.gif[/img] </a></div> </td>
<td width="102" height="23" bgcolor="#CCCCFF">
<div align="left">" class="link2">cancella</div></td>
</tr>
<%
oRst.MoveNext
Wend
%>
visualizza.asp (dove vorrei visualizzare la singola news)
codice:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim oRst
Dim cod
Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../../mdb-database/news.mdb")
oConn.Open
Set oRst = Server.CreateObject("ADODB.RecordSet")
%>
<%
oRst.Open "SELECT * FROM foto WHERE id="& cod &"", oConn, adOpenForwardOnly, adLockReadOnly
While not oRst.Eof
%>
<body><%=oRst("Titolo").Value%>
<%
oRst.MoveNext
Wend
%>