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

    Nessun valore specificato per alcuni parametri necessari.

    Una semplicissima connessione a database mi da problemi.probabilmente è semplice ma io non lo vedo.il codice è questo:

    <%
    sql = "SELECT * from usato"
    rs.Open sql, conn, 1, 3
    do while not rs.EOF
    %>

    e l'errore è:

    Tipo di errore:
    Microsoft JET Database Engine (0x80040E10)
    Nessun valore specificato per alcuni parametri necessari.
    /AFt/usato.asp, line 74

    linea 74 è rs.Open sql, conn, 1, 3

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Sicuro la query sia quella? Il nome della tabella è corretto?

    Roby

  3. #3
    si la query è quella e la tabela si chiama usato e fa parte di db_aft_usato

    la connessione è questa

    set conn=server.createobject("ADODB.connection")
    set rs=server.createobject("ADODB.recordset")
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & Server.MapPath("db_aft_usato.mdb")

    ho provato a mettere

    on error resume next
    if err.number <> 0 Then response.write err.description

    ma mi da un ulteriore errore e dice che scade il tempo massimo per eseguire uno script.
    Alla fine della pagina chiudo normalemente la connessione e il recordset

    <%
    conn.close
    rs.close
    %>


    ho specificato di far passare tutti i record del db e con loop chiudo il do until

    <%
    rs.movenext
    loop
    %>

    non ci vedo niente di strano...

  4. #4
    in realtà la query è

    <%
    sql = "SELECT * from usato order by data desc, id desc"
    rs.Open sql, conn, 1, 3
    do while not rs.EOF
    %>

    ma non cambia niente...

  5. #5
    sto guardando ma non trovo niente...sarà la tipa str...ata che non si trova perchè troppo facile...

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Posta lo script completo, non ho capito bene...

    Roby

  7. #7
    codice:
    <%
           'connessione con il db
           set conn=server.createobject("ADODB.connection")
           set rs=server.createobject("ADODB.recordset")
           conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & Server.MapPath("db_aft_usato.mdb")
    %>
    <body leftmargin="0" topmargin="6" bgcolor="#C0C0C0" background="images/sfondo.gif">
    
    
    <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" width="30" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          ID</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" width="80" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          Nome</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" width="100" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          Tipo</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          Dotazione</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          Caratteristiche Tecniche</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" width="50" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1">
                          Dimensioni</td>
                      <td align="center" height="20" bordercolor="#555555" bgcolor="#C0C0C0" width="50" style="border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: solid; border-bottom-width: 1; font-family:Verdana; font-size:8 pt; color:#555555">
                          Peso</td>
                    </tr>
                    <% 
                    sql = "SELECT * from usato order by data desc, id desc" 
                    rs.Open sql, conn, 1, 3 
                    do while not rs.EOF 
                    %>
                    <tr>
                      <td height="20" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium"> 
                         <%
                         Response.Write(rs.fields.item("id").value) 
                         %> 
                      </td>
                      <td height="20" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("nome").value)
                         %> 
                      </td>
                      <td height="20" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("tipo").value)
                         %> 
                      </td>
                      <td height="20" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("dotazione").value)
                         %> 
                      </td>
                      <td height="20" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("caratteristiche-tecniche").value)
                         %> 
                      </td>
                      <td height="20" style="border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("dimensioni").value)
                         %> 
                      </td>
                      <td height="20" style="border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
                         <%
                         Response.Write(rs.fields.item("peso").value)
                         %> 
                     </td>
                    <%
                    rs.movenext
                    loop
                    %>
    l'errore è

    Tipo di errore:
    Microsoft JET Database Engine (0x80040E10)
    Nessun valore specificato per alcuni parametri necessari.
    /AFt/usato.asp, line 74

    e la linea 74 è
    rs.Open sql, conn, 1, 3

    grazie mille


  8. #8
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    set rs=server.createObject("ADODB.Recordset")
    rs.Open sql, conn, 1, 3
    Roby

  9. #9
    no,scusa,non capisco,non ci vedo niente di sbagliato...

  10. #10
    sarò io,eh,ma proprio non capisco...

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.