Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 11
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174

    error 'ASP 0208 : 80004005'

    ho aggiunto ad un form per modificare i record database un form per caricare le immagini.
    Pur funzionando entrambe gli script, mi da questo errore:

    Request object error 'ASP 0208 : 80004005'
    Cannot use generic Request collection
    /marquee.asp, line 18
    Cannot use the generic Request collection after calling BinaryRead.

    codice invio img:
    <%
    Set Upload = Server.CreateObject("Persits.Upload")

    ' Do not throw the "Wrong ContentType error first time out
    Upload.IgnoreNoPost = True

    Count = Upload.Save(Server.MapPath("/public/"))

    If Count > 0 Then
    Response.Write Count & " I file sono stati caricati correttamente."
    End If
    %>

    codice modifica record:

    <%
    strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mdb-database/modifica.mdb") & ";Persist Security Info=False"

    If Request("Submit") <> "" Then
    intRecIDs = Replace(Request("hidRecIDs"), "*", "") ' remove all the asterisks, to create a list like this: 2, 5, 8, 9 etc.
    arrRecIDs = Split(intRecIDs, ", ") ' Create an array, wich will contain just the IDs of the records we need to update
    For intCount = 0 to Ubound(arrRecIDs) ' Loop trough the array


    strM1 = Replace(Request("mar1" & arrRecIDs(intCount)), "'", "''")
    strM2 = Replace(Request("mar2" & arrRecIDs(intCount)), "'", "''")
    strM3 = Replace(Request("mar3" & arrRecIDs(intCount)), "'", "''")
    strM4 = Replace(Request("mar4" & arrRecIDs(intCount)), "'", "''")
    strM5 = Replace(Request("mar5" & arrRecIDs(intCount)), "'", "''")

    set commUpdate = Server.CreateObject("ADODB.Command")
    commUpdate.ActiveConnection = strConnection
    commUpdate.CommandText = "UPDATE marquee SET marquee1 = '" & strM1 & "', marquee2 = '" & strM2 & "', marquee3 = '" & strM3 & "', marquee4 = '" & strM4 & "', marquee5 = '" & strM5 & "' WHERE ID = " & arrRecIDs(intCount)

    commUpdate.CommandType = 1
    commUpdate.CommandTimeout = 0
    commUpdate.Prepared = true
    commUpdate.Execute()


    Next
    strMessage = intCount & " Records Updated"
    Response.Redirect("marquee.asp?Message=" & strMessage)
    End If



    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = strConnection
    Recordset1.Source = "SELECT ID, marquee1, marquee2, marquee3, marquee4, marquee5 FROM marquee"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = -1
    Repeat1__index = 0
    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
    %>



    i 2 form:

    <form name="form1" method="post" action="xxx.asp">
    <form method="post" enctype="multipart/form-data" action="xxx.asp">


    Come evitare questo errore?
    Grazie
    Pattaya

  2. #2
    e la linea 18 di marquee.asp? qual'è?

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174
    If Request("Submit") <> "" Then
    Pattaya

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174
    Appunto la linea 18 è:
    If Request("Submit") <> "" Then

    i file li invia correttamente e quando aggiorno i record, con l'altro form li aggiorna correttamente.
    Pattaya

  5. #5
    Originariamente inviato da pattaya
    If Request("Submit") <> "" Then
    cosa vuol dire request("Submit")

    mmm da ciò che so io la request può avere collezioni che sono

    ClientCertificate ->Contiene i valori dei campi memorizzati nel certificato del client
    Cookies -> Contiene i cookie inviati in una richiesta HTTP
    Form -> Contiene i valori provenienti da una form inviata tramite il metodo post
    QueryString -> Contiene i valori delle variabili inviate tramite una richiesta HTTP
    ServerVariables -> Contiene tutti i valori delle variabili del server

    il request da solo non so cosa sia .. non posso aiutarti

  6. #6
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174
    non spedisce i dati ad un'altra pagina ma lo fa sulla stessa l'update
    Pattaya

  7. #7
    Originariamente inviato da pattaya
    non spedisce i dati ad un'altra pagina ma lo fa sulla stessa l'update
    se il tutto è contenuto in un form puoi fare request.form ... aspettiamo gente più esperta

  8. #8
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174
    No...!
    sono 2 form separati con 2 submit diversi
    Pattaya

  9. #9
    Originariamente inviato da pattaya
    No...!
    sono 2 form separati con 2 submit diversi
    quindi sono form cosa cambia che sono 2?

    bho comunque il request da solo non sembra esistere

  10. #10
    Utente di HTML.it
    Registrato dal
    Jun 2007
    Messaggi
    174
    Guarda...ti posto il codice completo così magari hai più chiaro.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%
    Set Upload = Server.CreateObject("Persits.Upload")

    ' Do not throw the "Wrong ContentType error first time out
    Upload.IgnoreNoPost = True

    Count = Upload.Save(Server.MapPath("/public/"))

    If Count > 0 Then
    Response.Write Count & " I file sono stati caricati correttamente."
    End If
    %>

    <%
    strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("mdb-database/modifica.mdb") & ";Persist Security Info=False"

    If Request("Submit") <> "" Then
    intRecIDs = Replace(Request("hidRecIDs"), "*", "") ' remove all the asterisks, to create a list like this: 2, 5, 8, 9 etc.
    arrRecIDs = Split(intRecIDs, ", ") ' Create an array, wich will contain just the IDs of the records we need to update
    For intCount = 0 to Ubound(arrRecIDs) ' Loop trough the array


    strM1 = Replace(Request("mar1" & arrRecIDs(intCount)), "'", "''")
    strM2 = Replace(Request("mar2" & arrRecIDs(intCount)), "'", "''")
    strM3 = Replace(Request("mar3" & arrRecIDs(intCount)), "'", "''")
    strM4 = Replace(Request("mar4" & arrRecIDs(intCount)), "'", "''")
    strM5 = Replace(Request("mar5" & arrRecIDs(intCount)), "'", "''")

    set commUpdate = Server.CreateObject("ADODB.Command")
    commUpdate.ActiveConnection = strConnection
    commUpdate.CommandText = "UPDATE marquee SET marquee1 = '" & strM1 & "', marquee2 = '" & strM2 & "', marquee3 = '" & strM3 & "', marquee4 = '" & strM4 & "', marquee5 = '" & strM5 & "' WHERE ID = " & arrRecIDs(intCount)

    commUpdate.CommandType = 1
    commUpdate.CommandTimeout = 0
    commUpdate.Prepared = true
    commUpdate.Execute()


    Next
    strMessage = intCount & " Records Updated"
    Response.Redirect("marquee.asp?Message=" & strMessage)
    End If



    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = strConnection
    Recordset1.Source = "SELECT ID, marquee1, marquee2, marquee3, marquee4, marquee5 FROM marquee"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index

    Repeat1__numRows = -1
    Repeat1__index = 0
    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
    %>



    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript">
    <!--
    // When the value in a textfield is changed, notice the onChange="RecUpdate('<%= intRecID %>')"
    // on each of the textfields, the value of the Record ID associated with that field
    // is passed to the RecUpdate function. First the value is surounded with 2 asterisks e.g. *6*
    // This is so that *1* can be distinguished from *10*, *11* etc.
    function RecUpdate(ID){
    var ThisID = "*" + (ID) + "*"
    if (document.form1.hidRecIDs.value == ""){ // If the hidden field is empty
    document.form1.hidRecIDs.value = (ThisID) // Store the value in the hidden field (hidRecIDs) as it is.
    }
    if (document.form1.hidRecIDs.value != ""){ // If the hidden field isn't empty
    var str = document.form1.hidRecIDs.value; // Store the contents of the hidden field in the variable str
    var pos = str.indexOf(ThisID); // Search str to see if this RecID is allready in it.
    if (pos == -1) { // If the position returned is -1 it isn't allredy in there,
    document.form1.hidRecIDs.value = document.form1.hidRecIDs.value + ", " + (ThisID)
    } // so add ", " and this ID to what is already in hidRecIDs
    } // to create a list like this *2*, *5*, *8* etc.
    }
    //-->
    </script>
    <head>
    <title>hotel trovatore di Jesolo Lido, Jesolo hotel, jesolo venezia hotels, alberghi di jesolo , jesolo alberghi, trovatore di albergo jesolo, trovatore di dormire a venezia jesolo; Hotel Trovatore</title>


    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-language" content="it" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="imagetoolbar" content="no" />
    <meta name="mssmarttagspreventparsing" content="true" />
    <meta name="description" content="Hotel Trovatore Jesolo, Hotels Jesolo, Jesolo Venezia, Ospitalità Venezia, Albergo Jesolo, Alberghi Jesolo, Alloggi Jesolo, Hotel Jesolo Lido, Venice Hotels, Hotel Venedig, Last Minute Jesolo, Vacanza Venezia, Vacanze al mare, Viaggio >Venezia, Informazioni Turistiche Jesolo, Prenotazioni jesolo, Veneto, Spiagge Jesolo, Mare Jesolo, Natura Venezia, Arte Venezia" />
    <meta name="copyright" content="This document copyright 2008 by Sabaidee" />
    <meta name="author" content="Joy" />
    <meta name="robots" content="all" />
    <meta name="robots" content="index, follow" />
    <meta name="rmar3sit-after" content="21 days" />
    <link rel="shortcut icon" href="favicon.ico" >
    <link href="style/style_modifica.css" rel="stylesheet" type="text/css" />

    </head>
    <body>

    <div id="wrap">
    <div id="header">
    <div id="logo"><h1>Hotel Trovatore</h1></div>
    <div id="flags">
    [img]image/flag_ita_hover.png[/img]

    [img]image/flag_eng_hover.png[/img]

    [img]image/flag_deu_hover.png[/img]
    </div>





    <form name="form1" method="post" action="marquee.asp">
    <table width="100%" border="0" cellspacing="10" cellpadding="10">

    <tr>
    <% intRecID =(Recordset1.Fields.Item("ID").Value) ' Store the current RecordID in a variable %>

    <td ><input style="width:100%; background:transparent; color:#F00; font-size:20px; font-weight:bold" name="mar1<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("marquee1").Valu e) %>" ></td>

    <td ><input style="width:100%; background: #FF0; color: #00F; font-size:20px; font-weight:bold" name="mar2<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("marquee2").Valu e)%>" ></td>

    <td ><input style="width:100%; background:transparent; color:#F00; font-size:20px; font-weight:bold" name="mar3<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("marquee3").Valu e)%>" ></td>

    <td ><input style="width:100%; background: #FF0; color: #00F; font-size:20px; font-weight:bold" name="mar4<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("marquee4").Valu e)%>" ></td>

    <td ><input style="width:100%; background:transparent; color:#F00; font-size:20px; font-weight:bold" name="mar5<%= intRecID %>" type="text" onChange="RecUpdate('<%= intRecID %>')" value="<%=(Recordset1.Fields.Item("marquee5").Valu e)%>" ></td>
    </tr>
    </table>


    <%
    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
    %>
    <% intRecID =(Recordset1.Fields.Item("ID").Value) ' Store the current RecordID in a variable %>


    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %>





    <input type="hidden" name="hidRecIDs" type="text" size="40">
    <input class="salva" type="submit" name="Submit" value="Salva scritta scorrevole">
    </form>
    </div>




















    <div style=" font-size:18px;background:#9FF; margin:0 auto; padding:20px; border:1px solid #000; text-align:center">Parte relativa all'angolo in alto a destra



    <form method="post" enctype="multipart/form-data" action="marquee.asp">
    <input class="scegli_file" type="file" name="file1" />


    <input class="scegli_file" type="file" name="file1" />


    <input class="salva_file" type="submit" value="Carica i file dell'angolo alto destro" />
    </form>

    </div>





    <input class="esci" type="submit" name="Submit" value="ESCI">


    </div>

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-4513753-5");
    pageTracker._trackPageview();
    } catch(err) {}</script>
    </body>

    </html>
    <%
    Recordset1.Close()
    Set Recordset1 = Nothing
    %>
    Pattaya

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.