Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    record casuali ad ogni accesso

    come posso fare per stampare 4 record a caso in funzione della SQL diversi ad ogni accesso?

    codice:
    <% 
    Set objConn = Server.CreateObject("ADODB.Connection") 
    objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/FPDB/wire_products.mdb") 
    strSQL=("SELECT TOP 4 * FROM products where new=true AND tip_UK<>'RFID' AND online= true ORDER BY ID DESC")
    set rs=server.CreateObject("ADODB.recordset")
    rs.Open strSQL, objConn
    do while not rs.EOF
    %>
               </td>
                  <td valign="top"><table  border="0" cellspacing="0" cellpadding="2">
                      <tr>
                        <td><span class="testigrigi"><span class='testo'><b class="right"><span class="copyright"><b class="right"><span class="testineri"><span class="titolirossi"><b class="testo">
                          <% if CInt(rs("New"))= true Then
    response.write "[img]/wireless/images/new.gif[/img]"
    End If
    %>
                        [/b]</span></span>[/b]</span>[/b]</span></span></td>
                      </tr>
                      <tr>
                        <td>&modulation=<%=rs("modulation")%>&comp_UK=<%=rs("comp_UK")%>&tip_UK=<%=rs("tip_UK")%>" title="technical info">[img]<%=rs([/img]" border="0" alt="<%=rs("titolo_UK")%>" width="82" height="52"></td>
                      </tr>
                      <tr>
                        <td class="right">&modulation=<%=rs("modulation")%>&comp_UK=<%=rs("comp_UK")%>&tip_UK=<%=rs("tip_UK")%>" title="technical info"><%=rs("model")%></td>
                      </tr>
                      <tr>
                        <td class="testo"><span class="right"><b class="right">[img]/wireless/images/pallino_a.gif[/img][/b]</span> <%=rs("titolo_UK")%></td>
                      </tr>
                  </table></td>
                  <td><%
    rs.movenext 
    loop
    %>
    Grazie!

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Tra gli script e/o articoli di http://freeasp.html.it c'era un esempio.

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.