Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 22

Discussione: errore current record

  1. #1

    errore current record

    ciao a tutti,
    vi descrivo brevemente il mio problema... dunque ho del codice asp scritto da un mio collega che mi da come risultato questo errore:

    --------------------------------------------------------------------------------------------
    ADODB.Field error '800a0bcd'

    Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

    /dettaglio.asp, line 59
    --------------------------------------------------------------------------------------------

    non capisco di preciso questo errore a cosa si riferisce se ad un errore di connessione con un record o altro... premetto che io uso php e so districarmi poco nel vedere al volo il codice asp.. comunque ve lo elenco..

    codice:
    </head>
    
    <body background="immagini/default1-10.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    
    <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td background="immagini/sfondo_03.gif"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
            <tr bgcolor="#CCFFFF"> 
              <td height="0" colspan="5" background="immagini/sfondo_03.gif" class="testo1"> 
                <div align="center" class="testo2">DETTAGLI AUTOVETTURA</div></td>
            </tr>
            <tr class="testo1"> 
    <% if (RS_offerta.Fields.Item("foto").Value)="" then %>
    		  <td width="36" bgcolor="#FFFFFF"> 
                <div align="center">[img]images/profilo_01.gif[/img]</div></td>
    		<% else %>
              <td width="36" bgcolor="#000000">
    <div align="center">[img]vedi.aspx?img=immagini/usato/<%=(RS_offerta.Fields.Item([/img]&l=160&h=120" border="0" onClick="MM_openBrWindow('immagine.asp?ID_auto=<%=(RS_offerta.Fields.Item("ID_auto").Value)%>','','width=640,height=480')"></div></td>
    <% end if %>
    io diciamo che ci sto impazzendo un po' e quindi ho avuto bisogno di chiedere aiuto a voi esperti del campo
    grazione!!!
    manumasterone

  2. #2
    Prima di usare il recordset, ovvero di richiamare i campi della tabella via recordset, è bene verificare che il recordset non sia vuoto, ovvero EOF (End Of File) oppure BOF (Beginning Of File):
    codice:
    <%
    if not RS_Offerta.EOF then
    response.write RS_Offerta("nomeCampo")
    end if
    %>

  3. #3
    mio dio mems tu sei sempre il guru onnipresente, un complimentone...
    dunque io ho aggiunto il tuo codice sostituendo al nome campo quello di "foto".
    solo che l'errore adesso è questo

    Microsoft VBScript runtime error '800a01a8'

    Object required: ''

    /dettaglio.asp, line 14

    :master:

    cosa significa secondo te
    manumasterone

  4. #4
    manco dioguruonniputento sa cosa c'è a linea 14 se non ce lo dici tu

  5. #5
    Originariamente inviato da manumasterone
    mio dio mems tu sei sempre il guru onnipresente, un complimentone...
    dunque io ho aggiunto il tuo codice sostituendo al nome campo quello di "foto".
    solo che l'errore adesso è questo

    Microsoft VBScript runtime error '800a01a8'

    Object required: ''

    /dettaglio.asp, line 14

    :master:

    cosa significa secondo te
    Dipende... facci vedere il codice completo.

  6. #6
    ok bene eccolo:

    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    
    <%
    ' dichiaro la variabile che conterrà l'oggetto Connection
    Dim conn
    'creo l'oggetto Connection
    Set conn = Server.CreateObject("ADODB.Connection")
    'apro la connessione con la fonte di dati
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.mapPath("\db\miodb.mdb")
    %>
    
    <%
    if not RS_Offerta.EOF then
    response.write RS_Offerta("foto")
    end if
    %>
    
    <%
    Dim RS_offerta__MMColParam
    RS_offerta__MMColParam = "1"
    If (Request.QueryString("ID_auto") <> "") Then 
      RS_offerta__MMColParam = Request.QueryString("ID_auto")
    End If
    %>
    
    <%
    Dim RS_offerta
    Dim RS_offerta_numRows
    
    Set RS_offerta = Server.CreateObject("ADODB.Recordset")
    RS_offerta.ActiveConnection = conn
    RS_offerta.Source = "SELECT * FROM T_auto WHERE ID_auto = " + Replace(RS_offerta__MMColParam, "'", "''") + ""
    RS_offerta.CursorType = 0
    RS_offerta.CursorLocation = 2
    RS_offerta.LockType = 1
    RS_offerta.Open()
    
    RS_offerta_numRows = 0
    %>
    <html>
    <head>
    <title>TAURISANO</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="stile1.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>
    
    <body background="immagini/default1-10.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    
    <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td background="immagini/sfondo_03.gif"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
            <tr bgcolor="#CCFFFF"> 
              <td height="0" colspan="5" background="immagini/sfondo_03.gif" class="testo1"> 
                <div align="center" class="testo2">DETTAGLI AUTOVETTURA</div></td>
            </tr>
            <tr class="testo1"> 
    <% if (RS_offerta.Fields.Item("foto").Value)="" then %>
    		  <td width="36" bgcolor="#FFFFFF"> 
                <div align="center">[img]images/profilo_01.gif[/img]</div></td>
    		<% else %>
              <td width="36" bgcolor="#000000">
    <div align="center">[img]vedi.aspx?img=immagini/usato/<%=(RS_offerta.Fields.Item([/img]&l=160&h=120" border="0" onClick="MM_openBrWindow('immagine.asp?ID_auto=<%=(RS_offerta.Fields.Item("ID_auto").Value)%>','','width=640,height=480')"></div></td>
    <% end if %>
    
              <td width="364"colspan="4" valign="top" bgcolor="#CCFFFF"> 
                
    
    marca:<span class="testo2"><%=(RS_offerta.Fields.Item("marca").Value)%></span>
    
                  modello:<span class="testo2"><%=(RS_offerta.Fields.Item("modello").Value)%></span>
    
                  versione:<span class="testo2"><%=(RS_offerta.Fields.Item("versione").Value)%></span>
    
                  colore:<%=(RS_offerta.Fields.Item("colore").Value)%>
    
                  cilindrata:<%=(RS_offerta.Fields.Item("cc").Value)%>
    
                  alimentazione:<%=(RS_offerta.Fields.Item("alim").Value)%>
    
                  CV:<%=(RS_offerta.Fields.Item("CV").Value)%>•KW:<%=(RS_offerta.Fields.Item("KW").Value)%>
    
                  chilometri:<%=(RS_offerta.Fields.Item("chilometri").Value)%>
    
                  prezzo: <%=(RS_offerta.Fields.Item("prezzo").Value)%>
    
                </p>
                </td>
            </tr>
            <tr class="testo1"> 
              <td colspan="5" background="immagini/sfondo_03.gif" bgcolor="#FFFFFF"> 
                <div align="center">ALTRE INFORMAZIONI</div></td>
            </tr>
            <tr bgcolor="#CCFFFF" class="testo1"> 
              <td colspan="5"> 
                <p align="justify"><%=(RS_offerta.Fields.Item("altro").Value)%></p>
                <div align="center"></div>
                <div align="center"></div>
                <div align="center"></div>
                <div align="right"></div></td>
            </tr>
          </table></td>
      </tr>
    </table>
    <div align="center">
    
      TORNA ALLA PAGINA PRECEDENTE</div>
    </body>
    </html>
    <%
    RS_offerta.Close()
    Set RS_offerta = Nothing
    %>
    ok ecco tutto quello che c'è nella pagina....
    cmq nella linea 14 c'è il codice che ho aggiunto per la verifica come mi diceva mems ovvero questo:
    codice:
    <%
    if not RS_Offerta.EOF then
    response.write RS_Offerta("foto")
    end if
    %>
    grazie mille gente
    manumasterone

  7. #7
    hai messo rsofferta troppo presto

  8. #8
    troppo presto??

    e dove dovrei metterlo... io ho fatto delle prove a sostituirlo ma non va ugualmente!!!
    manumasterone

  9. #9
    Classico esempio di copia e incolla.
    Il mio era un esempio, non codice da prendere e incollare così com'è.
    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    
    <%
    ' dichiaro la variabile che conterrà l'oggetto Connection
    Dim conn
    'creo l'oggetto Connection
    Set conn = Server.CreateObject("ADODB.Connection")
    'apro la connessione con la fonte di dati
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.mapPath("\db\miodb.mdb")
    %>
    
    <%
    Dim RS_offerta__MMColParam
    RS_offerta__MMColParam = "1"
    If (Request.QueryString("ID_auto") <> "") Then 
      RS_offerta__MMColParam = Request.QueryString("ID_auto")
    End If
    %>
    
    <%
    Dim RS_offerta
    Dim RS_offerta_numRows
    
    Set RS_offerta = Server.CreateObject("ADODB.Recordset")
    RS_offerta.ActiveConnection = conn
    RS_offerta.Source = "SELECT * FROM T_auto WHERE ID_auto = " + Replace(RS_offerta__MMColParam, "'", "''") + ""
    RS_offerta.CursorType = 0
    RS_offerta.CursorLocation = 2
    RS_offerta.LockType = 1
    RS_offerta.Open()
    
    RS_offerta_numRows = 0
    %>
    <html>
    <head>
    <title>TAURISANO</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="stile1.css" rel="stylesheet" type="text/css">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>
    
    <body background="immagini/default1-10.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    
    <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr> 
        <td background="immagini/sfondo_03.gif"> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
            <tr bgcolor="#CCFFFF"> 
              <td height="0" colspan="5" background="immagini/sfondo_03.gif" class="testo1"> 
                <div align="center" class="testo2">DETTAGLI AUTOVETTURA</div></td>
            </tr>
            <tr class="testo1">
    <% if not RS_offerta.EOF then %> 
    <% if (RS_offerta.Fields.Item("foto").Value)="" then %>
    		  <td width="36" bgcolor="#FFFFFF"> 
                <div align="center">[img]images/profilo_01.gif[/img]</div></td>
    		<% else %>
              <td width="36" bgcolor="#000000">         
    <div align="center">[img]vedi.aspx?img=immagini/usato/<%=(RS_offerta.Fields.Item([/img]&l=160&h=120" border="0" onClick="MM_openBrWindow('immagine.asp?ID_auto=<%=(RS_offerta.Fields.Item("ID_auto").Value)%>','','width=640,height=480')"></div></td>
    <% end if %>
    
              <td width="364"colspan="4" valign="top" bgcolor="#CCFFFF"> 
                
    
    marca: <span class="testo2"><%=(RS_offerta.Fields.Item("marca").Value)%></span>
    
                  modello: <span class="testo2"><%=(RS_offerta.Fields.Item("modello").Value)%></span>
    
                  versione: <span class="testo2"><%=(RS_offerta.Fields.Item("versione").Value)%></span>
    
                  colore: <%=(RS_offerta.Fields.Item("colore").Value)%>
    
                  cilindrata: <%=(RS_offerta.Fields.Item("cc").Value)%>
    
                  alimentazione: <%=(RS_offerta.Fields.Item("alim").Value)%>
    
                  CV: <%=(RS_offerta.Fields.Item("CV").Value)%> • KW: <%=(RS_offerta.Fields.Item("KW").Value)%>
    
                  chilometri: <%=(RS_offerta.Fields.Item("chilometri").Value)%>
    
                  prezzo: <%=(RS_offerta.Fields.Item("prezzo").Value)%>
    
                </p>
                </td>
            </tr>
            <tr class="testo1"> 
              <td colspan="5" background="immagini/sfondo_03.gif" bgcolor="#FFFFFF"> 
                <div align="center">ALTRE INFORMAZIONI</div></td>
            </tr>
            <tr bgcolor="#CCFFFF" class="testo1"> 
              <td colspan="5"> 
                <p align="justify"><%=(RS_offerta.Fields.Item("altro").Value)%></p>
                <div align="center"></div>
                <div align="center"></div>
                <div align="center"></div>
                <div align="right"></div></td>
    <% else %>
               <td bgcolor="#FFFFFF">Dati non disponibili</td>
    <% end if %>
            </tr>
          </table></td>
      </tr>
    </table>
    <div align="center">
    
      TORNA ALLA PAGINA PRECEDENTE</div>
    </body>
    </html>
    <%
    RS_offerta.Close()
    Set RS_offerta = Nothing
    %>

  10. #10
    Originariamente inviato da Mems
    Classico esempio di copia e incolla.

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.