Una possibile soluzione è questa.
Come vedi, la creazione delle variabili che contengono i campi del recordset è spostata dopo il tag di apertura della tabella html, all'interno di un ciclo che scorre tutto il recordset leggendo i record dal primo all'ultimo e mostrandoli nella tabella.
Dopo la lettura dell'ultimo record, la tabella viene chiusa.
Poi farai tu le modifiche opportune.
Importante: alla fine di tutto ricordati di chiudere e distruggere il recordset e la connessione, con le istruzionicodice:<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@LANGUAGE="VBSCRIPT"%> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <% modello=request.querystring("modello") sql=" SELECT MARCA.MARCA, MODELLO.MODELLO, CARATTERISTICHE.ALIMENTAZIONE, CARATTERISTICHE.PREZZO, CARATTERISTICHE.POTENZA, CARATTERISTICHE.ANNO FROM (MARCA INNER JOIN MODELLO ON MARCA.ID = MODELLO.MARCA) INNER JOIN CARATTERISTICHE ON MODELLO.ID = CARATTERISTICHE.MODELLO " Set OBJdbConnection=Server.CreateObject("ADODB.Connection") OBJdbConnection.open"driver={Microsoft Access Driver (*.mdb)};dbq="&server.mapPath("../db/autoweb.mdb") Set Rs=OBJdbConnection.Execute(sql) %> <title></title> <style type="text/css"> <!-- body { font-family: "Century Gothic"; color: #000000; } .Stile1 {color: #000000} .Stile31 {font-size: small} .Stile38 {color: #000000; font-size: medium;} --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> <body> </p> <table width="771" height="228" border="0" align="left" cellpadding="2" cellspacing="2" id="fattura"> <% do until rs.eof marca=rs("marca") modello=rs("modello") alimentazione=rs("alimentazione") prezzo=rs("prezzo") potenza=rs("potenza") anno=rs("anno") %> <tr align="left" valign="middle"> <td width="172" height="34"> <div align="justify" class="Stile31 Stile1">Marca vettura </div></td> <td width="111"><span class="Stile1"><%=marca%></span></td> <td width="123"> </td> <td width="339"> </td> </tr> <tr align="left" valign="middle"> <td height="36"> <div align="justify" class="Stile31 Stile1">Modello vettura </div></td> <td><span class="Stile1"><%=modello%></span></td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td height="36"><div align="justify" class="Stile31 Stile1">Alimentazione</div></td> <td><span class="Stile1"><%=alimentazione%></span></td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td height="36"><div align="justify" class="Stile31 Stile1">Prezzo</div></td> <td><span class="Stile1"><%=prezzo%></span></td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td height="36"><div align="justify" class="Stile31 Stile1">Potenza in CV </div></td> <td><span class="Stile1"><%=potenza%> </span></td> <td> </td> <td> </td> </tr> <tr align="left" valign="middle"> <td height="36"> </td> <td> </td> <td> </td> </tr> <% rs.movenext loop %> </table> <div align="center"> <div align="justify"> </p> </p> </p> </p> </p> </body> </head> </html>
codice:rs.close set rs = nothing OBJdbConnection.close set OBJdbConnection = nothing![]()

Rispondi quotando