Visualizzazione dei risultati da 1 a 10 su 10

Discussione: Errore sconosciuto

  1. #1
    Utente di HTML.it
    Registrato dal
    Apr 2002
    Messaggi
    364

    Errore sconosciuto

    Qualcuno sà la causa di quest'errore?????

    è la prima volta che mi capita

    Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

    Si sono verificati errori in un'operazione OLE DB composta da più passaggi. Controllare i singoli valori di stato OLE DB, se disponibili. Nessuna operazione eseguita.

    Grazie anticipatamente

  2. #2

  3. #3
    Utente di HTML.it
    Registrato dal
    Apr 2002
    Messaggi
    364
    Set rs = Server.CreateObject("ADODB.Recordset")
    sql="SELECT * FROM eventi WHERE IDEvento="&id
    response.write sql

    rs.Open sql, conn

    <%if not rs.eof then
    descrizionetemp=rs("DescrizioneEvento")
    if not (isnull(descrizionetemp)) then
    descrizione=CheckString2(CStr(descrizionetemp))
    else
    descrizione=""
    end if
    end if

    l'errore lo da su questa riga
    "descrizionetemp=rs("DescrizioneEvento")"

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    La query restituisce un solo record??

    roby

  5. #5
    Utente di HTML.it
    Registrato dal
    Apr 2002
    Messaggi
    364
    la query restituisce un solo record il problema deve essere sul campo in quanto prima di leggermi rs("DescrizioneEvento") mi leggo altri campi su cui non mi da errore ma non capisco cosa possa essere.

    la query è corretta se la sparo direttamente su mysql non mi da nessun problema

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

    Roby

  7. #7
    Utente di HTML.it
    Registrato dal
    Apr 2002
    Messaggi
    364
    ho omesso il javascript

    <%
    Response.Expires = 0
    Response.Expiresabsolute = Now() - 1
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "no-cache"
    Response.buffer=False
    if session("auut")<>"admin_sito" then response.redirect("esci.asp") end if
    if Instr(session("privilegi"),";35;")=0 then
    response.redirect("gestione_sistema.asp")
    end if
    Function CheckString2(strInput)
    if strInput<>"" then
    strTemp = Replace(strInput, "``","&quot;")
    strTemp = Replace(strTemp, "`","'")
    strTemp = Replace(strTemp, "
    ",vbcr)
    CheckString2 = strTemp
    else
    CheckString2 = ""
    end if
    End Function


    id=request.querystring("id")
    statov=request.querystring("statov")
    s1=request.querystring("s1")
    %>

    <%
    Set rs = Server.CreateObject("ADODB.Recordset")
    sql="SELECT * FROM eventi WHERE IDEvento="&id
    response.write sql

    rs.Open sql, conn
    %>
    <html>
    <head>
    <link rel="stylesheet" href="../css/body.css">
    <title>AMMINISTRAZIONE - Scheda Eventi</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#FFFFFF" text="#000000">
    <%if not rs.eof then %>
    <div align="center">


    <span class="TITOLOVERDEC">AMMINISTRAZIONE

    Scheda Eventi</span></p>
    <form name="Form1" method="post" onsubmit="return Registra_Validator(this)" action="modifica_eventi.asp">
    <table border="2" cellspacing="1" bordercolor="#336600" width="539">
    <tr>
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Nome
    Evento/tipologia</font>
    </td>
    <td width="122">
    <input type="text" name="nome" value="<%=CheckString2(CStr(rs("nome")))%>">
    </td>
    <td bgcolor="#E2ECD9" align="center" width="80"><font color='#336600'>Priorità</font></td>
    <td width="186">
    <input type="text" name="sortorder" value="<%=rs("SortOrder")%>">
    </td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Tema</font></td>
    <td width="122">
    <input type="text" name="titolo" value="<%=CheckString2(CStr(rs("Tema")))%>">
    </td>
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Luogo/data/dove</font></td>
    <td width="122">
    <input type="text" name="comune" value="<%=CheckString2(rs("IDComune"))%>">
    </td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" align="center" width="80"><font color='#336600'>Tipo</font></td>
    <td width="186">
    <input type="text" name="tipo" value="<%=CheckString2(rs("TipoEvento"))%>">
    </td>
    <td bgcolor="#E2ECD9" align="center" width="80"></td>
    <td width="186"></td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Visualizzazione
    in Agenda</font>
    </td>
    <td width="122" colspan="3">
    <input type="checkbox" name="agenda" value="on">
    </td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Testo
    evento</font>
    </td>
    <td colspan="3">
    <%
    if rs("DescrizioneEvento")<> "" then
    descrizionetemp= rs("DescrizioneEvento")
    if not (isnull(descrizionetemp)) then
    descrizione=CheckString2(CStr(descrizionetemp))
    else
    descrizione=""
    end if
    end if
    %>
    <textarea name="tema" cols="30" rows="3"><%=descrizione%></textarea>
    </td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" align="center" rowspan="2" width="89"><font color='#336600'>Immagine</font></td>
    <td width="122" rowspan="2">



    <select name="img">
    <option value="">Seleziona Immagine</option>
    <%
    strPath = "../img/img_eve/"
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(Server.MapPath(strPath))
    For Each objItem In objFolder.Files
    if lcase(right(objItem.Name,4))=".gif" or lcase(right(objItem.Name,4))=".jpg" then
    response.write("<option value=" & chr(34) & objItem.Name & chr(34))
    if CheckString2(rs("LinkImmagine"))=objItem.Name then
    response.write(" selected")
    end if
    response.write(">"& objItem.Name & "</option>")
    end if
    Next
    Set objItem = Nothing
    Set objFolder = Nothing
    Set objFSO = Nothing
    %>
    </select>
    </p>
    </td>
    <td bgcolor="#E2ECD9" align="center" width="80"> <font color='#336600'>Link</font>
    </td>
    <td width="186">
    <input type="text" name="linko" value="<%=CheckString2(rs("Link"))%>">
    </td>
    </tr>
    <tr>
    <td bgcolor="#E2ECD9" width="80" height="69" align="center"><font color='#336600'>Descrizione</font></td>
    <td width="186">
    <textarea name="descrizione" cols="30" rows="3"><%=CheckString2(rs("DescrizioneImmagine") )%></textarea>
    </td>
    </tr>
    </table>



    <input type="hidden" name="id" value="<%=rs("IDEvento")%>">
    <input type="hidden" name="statov" value="<%=statov%>">
    <input type="hidden" name="s1" value="<%=s1%>">
    <input type="submit" name="Modifica" value="Applica">
    </p>
    </form>


    <table border="2" cellspacing="1" bordercolor="#336600" width="600">
    <tr>
    <td bgcolor="#E2ECD9" align="center" colspan="5"><font color='#336600'>ALLEGATI</font></td>
    </tr>
    <tr>
    <td colspan="5"> <form method="POST" onSubmit="return Controlla_Upload(this)" enctype="multipart/form-data" action="upload.asp">
    <font color="#336600">File: </font>
    <input type="file" name="blob" size=30>
    <font color="#336600">Priorità: </font>
    <input name="sortfile" type="text" value="5" size="5">




    <font color="#336600">Descrizione: </font>
    <input name="descrizionefile" type="text" size="80" maxlength="100">




    <div align="center">
    <input type="hidden" name="percorso" value="../all/all_even">
    <input type="hidden" name="id" value="<%=rs("IDEvento")%>">
    <input type="hidden" name="info" value="z">
    <input type="hidden" name="statov" value="<%=statov%>">
    <input type="hidden" name="s1" value="<%=s1%>">
    <input type="submit" name="Enter" value="Aggiungi">
    </div>
    </form></td>
    </tr>
    <%
    sql="SELECT IDEventoFile,Descrizione,LinkToFile,SortOrder FROM eventifile WHERE IDEvento="&id&" ORDER BY SortOrder"
    set rs2=conn.execute(sql)
    if not rs2.eof then
    arrayrecord=rs2.GetRows
    num=ubound(arrayrecord,2)
    %>
    <tr>
    <td bgcolor="#E2ECD9" align="center" colspan="5"><font color='#336600'>File
    già allegati</font>
    </td>
    </tr>
    <tr>
    <td width="41" align="center" bgcolor="#E2ECD9"><font color='#336600'>N.</font></td>
    <td bgcolor="#E2ECD9" align="center"><font color='#336600'>Descrizione</font></td>
    <td width="44" align="center" bgcolor="#E2ECD9"><font color='#336600'>Priorità</font></td>
    <td width="64" align="center" bgcolor="#E2ECD9"></td>
    <td width="59" align="center" bgcolor="#E2ECD9"></td>
    </tr>
    <form name="Form3" method="post" onsubmit="return Controlla_Allegati(this,<%=num+1%>)" action="modifica_stato_allegati.asp">
    <%
    for j=0 to num
    %>
    <tr>
    <td width="41" align="center"><span class="TESTONERO"><%=(j+1)%></span></td>
    <td width="362" align="justify"><span class="TESTONERO"><%=CheckString2(arrayrecord(1,j) )%></span></td>
    <td width="44" align="center"><input name="sortfile" type="text" id="sortfile" value="<%=arrayrecord(3,j)%>" size="5"></td>
    <td width="64" align="center"> <input onClick='Replace(1,<%=rs("IDEvento")%>,<%=arrayrec ord(0,j)%>,"<%=statov%>","<%=s1%>")' type="button" value="Modifica">
    </td>
    <td width="59"> <input onClick='Replace(2,<%=rs("IDEvento")%>,<%=arrayrec ord(0,j)%>,"<%=statov%>","<%=s1%>")' type="button" value="Elimina">
    </td>
    </tr>
    <%
    next
    %>
    <tr>
    <td align="center" colspan="5">
    <input type="hidden" name="num" value="<%=num%>">
    <input type="hidden" name="sortlist">
    <input type="hidden" name="info" value="z">
    <input type="hidden" name="id" value="<%=rs("IDEvento")%>">
    <input type="hidden" name="statov" value="<%=statov%>">
    <input type="hidden" name="s1" value="<%=s1%>">
    <input type="submit" value="Applica">
    </td>
    </tr>
    </form>
    <%
    end if
    if rs2.State<>0 then
    rs2.close
    end if
    set rs2=nothing
    %>
    </table>


    <span class="TESTONERO"><font color='#336600'>Indietro</font></span></p>
    </div>
    <%
    if rs.State<>0 then
    rs.close
    end if
    set rs=nothing
    %>

    <%end if %>
    </body>
    </html>

  8. #8

  9. #9
    Utente di HTML.it
    Registrato dal
    Apr 2002
    Messaggi
    364
    ho omesso il javascript

    codice:
    <% 
    Response.Expires = 0 
    Response.Expiresabsolute = Now() - 1 
    Response.AddHeader "pragma","no-cache" 
    Response.AddHeader "cache-control","private" 
    Response.CacheControl = "no-cache" 
    Response.buffer=False 
    if session("auut")<>"admin_sito" then response.redirect("esci.asp") end if 
    if Instr(session("privilegi"),";35;")=0 then 
    response.redirect("gestione_sistema.asp") 
    end if 
    Function CheckString2(strInput) 
    if strInput<>"" then 
    strTemp = Replace(strInput, "``",""") 
    strTemp = Replace(strTemp, "`","'") 
    strTemp = Replace(strTemp, "
    ",vbcr) 
    CheckString2 = strTemp 
    else 
    CheckString2 = "" 
    end if 
    End Function 
    
    
    id=request.querystring("id") 
    statov=request.querystring("statov") 
    s1=request.querystring("s1") 
    %> 
     
    <% 
    Set rs = Server.CreateObject("ADODB.Recordset") 
    sql="SELECT * FROM eventi WHERE IDEvento="&id 
    response.write sql 
    
    rs.Open sql, conn 
    %> 
    <html> 
    <head> 
    <link rel="stylesheet" href="../css/body.css"> 
    <title>AMMINISTRAZIONE - Scheda Eventi</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    </head> 
    
    <body bgcolor="#FFFFFF" text="#000000"> 
    <%if not rs.eof then %> 
    <div align="center"> 
    
    
    <span class="TITOLOVERDEC">AMMINISTRAZIONE
     
    Scheda Eventi</span></p> 
    <form name="Form1" method="post" onsubmit="return Registra_Validator(this)" action="modifica_eventi.asp"> 
    <table border="2" cellspacing="1" bordercolor="#336600" width="539"> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Nome 
    Evento/tipologia</font></td> 
    <td width="122"> 
    <input type="text" name="nome" value="<%=CheckString2(CStr(rs("nome")))%>"> 
    </td> 
    <td bgcolor="#E2ECD9" align="center" width="80"><font color='#336600'>Priorità</font></td> 
    <td width="186"> 
    <input type="text" name="sortorder" value="<%=rs("SortOrder")%>"> 
    </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Tema</font></td> 
    <td width="122"> 
    <input type="text" name="titolo" value="<%=CheckString2(CStr(rs("Tema")))%>"> 
    </td> 
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Luogo/data/dove</font></td> 
    <td width="122"> 
    <input type="text" name="comune" value="<%=CheckString2(rs("IDComune"))%>"> 
    </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" width="80"><font color='#336600'>Tipo</font></td> 
    <td width="186"> 
    <input type="text" name="tipo" value="<%=CheckString2(rs("TipoEvento"))%>"> 
    </td> 
    <td bgcolor="#E2ECD9" align="center" width="80"> </td> 
    <td width="186"> </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Visualizzazione 
    in Agenda</font></td> 
    <td width="122" colspan="3"> 
    <input type="checkbox" name="agenda" value="on"> 
    </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" width="89"><font color="#336600">Testo 
    evento</font></td> 
    <td colspan="3"> 
    <% 
    if rs("DescrizioneEvento")<> "" then 
    descrizionetemp= rs("DescrizioneEvento") 
    if not (isnull(descrizionetemp)) then 
    descrizione=CheckString2(CStr(descrizion
    etemp)) 
    else 
    descrizione="" 
    end if 
    end if 
    %> 
    <textarea name="tema" cols="30" rows="3"><%=descrizione%></textarea> 
    </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" rowspan="2" width="89"><font color='#336600'>Immagine</font></td> 
    <td width="122" rowspan="2"> 
    
    
     
    <select name="img"> 
    <option value="">Seleziona Immagine</option> 
    <% 
    strPath = "../img/img_eve/" 
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 
    Set objFolder = objFSO.GetFolder(Server.MapPath(strPath)) 
    For Each objItem In objFolder.Files 
    if lcase(right(objItem.Name,4))=".gif" or lcase(right(objItem.Name,4))=".jpg" then 
    response.write("<option value=" & chr(34) & objItem.Name & chr(34)) 
    if CheckString2(rs("LinkImmagine"))=objItem.Name then 
    response.write(" selected") 
    end if 
    response.write(">"& objItem.Name & "</option>") 
    end if 
    Next 
    Set objItem = Nothing 
    Set objFolder = Nothing 
    Set objFSO = Nothing 
    %> 
    </select> 
    </p> 
    </td> 
    <td bgcolor="#E2ECD9" align="center" width="80"> <font color='#336600'>Link</font> 
    </td> 
    <td width="186"> 
    <input type="text" name="linko" value="<%=CheckString2(rs("Link"))%>"> 
    </td> 
    </tr> 
    <tr> 
    <td bgcolor="#E2ECD9" width="80" height="69" align="center"><font color='#336600'>Descrizione</font></td> 
    <td width="186"> 
    <textarea name="descrizione" cols="30" rows="3"><%=CheckString2(rs("DescrizioneImmagine"))%></textarea> 
    </td> 
    </tr> 
    </table> 
    
    
     
    <input type="hidden" name="id" value="<%=rs("IDEvento")%>"> 
    <input type="hidden" name="statov" value="<%=statov%>"> 
    <input type="hidden" name="s1" value="<%=s1%>"> 
    <input type="submit" name="Modifica" value="Applica"> 
    </p> 
    </form> 
    
     
    <table border="2" cellspacing="1" bordercolor="#336600" width="600"> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" colspan="5"><font color='#336600'>ALLEGATI</font></td> 
    </tr> 
    <tr> 
    <td colspan="5"> <form method="POST" onSubmit="return Controlla_Upload(this)" enctype="multipart/form-data" action="upload.asp"> 
    <font color="#336600">File: </font> 
    <input type="file" name="blob" size=30> 
    <font color="#336600">Priorità: </font> 
    <input name="sortfile" type="text" value="5" size="5"> 
    
     
    
     
    <font color="#336600">Descrizione: </font> 
    <input name="descrizionefile" type="text" size="80" maxlength="100"> 
    
     
    
     
    <div align="center"> 
    <input type="hidden" name="percorso" value="../all/all_even"> 
    <input type="hidden" name="id" value="<%=rs("IDEvento")%>"> 
    <input type="hidden" name="info" value="z"> 
    <input type="hidden" name="statov" value="<%=statov%>"> 
    <input type="hidden" name="s1" value="<%=s1%>"> 
    <input type="submit" name="Enter" value="Aggiungi"> 
    </div> 
    </form></td> 
    </tr> 
    <% 
    sql="SELECT IDEventoFile,Descrizione,LinkToFile,Sort
    Order FROM eventifile WHERE IDEvento="&id&" ORDER BY SortOrder" 
    set rs2=conn.execute(sql) 
    if not rs2.eof then 
    arrayrecord=rs2.GetRows 
    num=ubound(arrayrecord,2) 
    %> 
    <tr> 
    <td bgcolor="#E2ECD9" align="center" colspan="5"><font color='#336600'>File 
    già allegati</font></td> 
    </tr> 
    <tr> 
    <td width="41" align="center" bgcolor="#E2ECD9"><font color='#336600'>N.</font></td> 
    <td bgcolor="#E2ECD9" align="center"><font color='#336600'>Descrizione</font></td> 
    <td width="44" align="center" bgcolor="#E2ECD9"><font color='#336600'>Priorità</font></td> 
    <td width="64" align="center" bgcolor="#E2ECD9"> </td> 
    <td width="59" align="center" bgcolor="#E2ECD9"> </td> 
    </tr> 
    <form name="Form3" method="post" onsubmit="return Controlla_Allegati(this,<%=num+1%> )" action="modifica_stato_allegati.asp"> 
    <% 
    for j=0 to num 
    %> 
    <tr> 
    <td width="41" align="center"><span class="TESTONERO"><%=(j+1)%></span></td> 
    <td width="362" align="justify"><span class="TESTONERO"><%=CheckString2(arrayrecord(1,j))%></span></td> 
    <td width="44" align="center"><input name="sortfile" type="text" id="sortfile" value="<%=arrayrecord(3,j)%>" size="5"></td> 
    <td width="64" align="center"> <input onClick='Replace(1,<%=rs("IDEvento")%>,<%=arrayrecord(0,j)%>,"<%=statov%>","<%=s1%>")' type="button" value="Modifica"> 
    </td> 
    <td width="59"> <input onClick='Replace(2,<%=rs("IDEvento")%>,<%=arrayrecord(0,j)%>,"<%=statov%>","<%=s1%>")' type="button" value="Elimina"> 
    </td> 
    </tr> 
    <% 
    next 
    %> 
    <tr> 
    <td align="center" colspan="5"> 
    <input type="hidden" name="num" value="<%=num%>"> 
    <input type="hidden" name="sortlist"> 
    <input type="hidden" name="info" value="z"> 
    <input type="hidden" name="id" value="<%=rs("IDEvento")%>"> 
    <input type="hidden" name="statov" value="<%=statov%>"> 
    <input type="hidden" name="s1" value="<%=s1%>"> 
    <input type="submit" value="Applica"> 
    </td> 
    </tr> 
    </form> 
    <% 
    end if 
    if rs2.State<>0 then 
    rs2.close 
    end if 
    set rs2=nothing 
    %> 
    </table> 
    
    
    <span class="TESTONERO"><font color='#336600'>Indietro</font></span></p> 
    </div> 
    <% 
    if rs.State<>0 then 
    rs.close 
    end if 
    set rs=nothing 
    %> 
     
    <%end if %> 
    </body> 
    </html>

  10. #10
    Non vedo l'apertura della connessione, magari è in qualche include. :master:

    PS. Hai voglia di levare un po' di peli... ehm, codici superflui almeno per prova?
    Tutte le parti form statiche sono inutili per la verifica e complicano solo la lettura.

    DImenticavo.. la riga d'errore quale è?


    <edit> riga trovata </edit>

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 © 2026 vBulletin Solutions, Inc. All rights reserved.