:master: ok :
codice:
<%id = trim(request.querystring("id"))
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = d:\inetpub\webs\....mdb")
Set objRs = Server.CreateObject("ADODB.Recordset")
set objRs = objConn.Execute("SELECT Clienti.IDCliente, Clienti.[Cognome e Nome] AS Cliente, [Tipologie Trattamenti].[Descrizione Trattamento], Trattamenti.Data, Trattamenti.OraInizio, Trattamenti.Importo, Dipendenti.[Cognome e Nome]As Dipendente FROM Dipendenti RIGHT JOIN ([Tipologie Trattamenti] RIGHT JOIN (Clienti RIGHT JOIN Trattamenti ON Clienti.IDCliente = Trattamenti.IDCliente) ON [Tipologie Trattamenti].[IDTipo Trattamento] = Trattamenti.[IDTipo Trattamento]) ON Dipendenti.IDImpiegato = Trattamenti.IDImpiegato WHERE Clienti.IDCliente="& id)
precedente=""
while NOT objRs.EOF
if precedente<>objRs("IDCliente") then
%>
<table border="1" cellpadding="6" cellspacing="6">
<tr>
<td>ID</td>
<td>Cognome e Nome</td>
</tr>
<tr>
<td><%=objRs("IDCliente")%></td>
<td><%=objRs("Cliente")%></td>
</tr>
<tr>
<td align="left"></td>
<td align="left">Data</td>
<td align="left">Ora</td>
<td align="left">Trattamento</td>
<td align="left">Operatore</td>
<td align="left">Importo</td>
</tr>
<%
else
precedente=objRs("IDCliente")
Response.write "ancora non risulta preso alcun appuntamento"
end if
%>
<tr>
<td></td>
<td align="left"><%=objRs("Data")%></td>
<td align="left"><%=objRs("OraInizio")%></td>
<td align="left"><%=objRs("Descrizione Trattamento")%></td>
<td align="left"><%=objRs("Dipendente")%></td>
<td align="left"><%=objRs("Importo")%></td>
</tr>
<%
objRs.Movenext
wend
objRs.Close
Set objRs = Nothing
objConn.Close
Set objConn = Nothing
%>
</table>