Salve a tutti, qualcuno saprebbe dirmi come sistemare il seguente codice per evitare la ripetizione di uno stesso utente per ogni commento inserito?
Il database è così composto :
Tabella Utenti (IdUtente, Nome)
Tabella Commenti (IdComm, Data, Commento, IdUtente)
Ringrazio anticipatamente chiunque decida di aiutarmi.
<html>
<head>
<title>pagina 1</title>
</head>
<body>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\......Commenti_Utenti_Sito.mdb")
Set objRs = Server.CreateObject("ADODB.Recordset")
set objRs = objConn.Execute("SELECT DISTINCT Utenti.IDUtente, Nome, Data, Commento FROM Utenti RIGHT JOIN Commenti ON Utenti.IDUtente = Commenti.IDUtente;")
Do while NOT objRs.EOF
response.write "<ul style=list-style:none>"&"[*]"&objRs("IDUtente")
response.write objRs("Nome")
response.write "<ul style=list-style:none>"&"[*]"&objRs("Data")
response.write objRs("Commento")&""&"[/list]"&""&"[/list]"
response.write "<hr size='1' color='midnightbluè width='40%' align='left'>"
objRs.Movenext
Loop
objRs.Close
Set objRs = Nothing
objConn.Close
Set objConn = Nothing
%>
</body>
</html>

Rispondi quotando