• User Newbie

    Microsoft VBScript runtime error '800a000d' Type mismatch: 'rs'

    Salve ho eseguito ho questa che mi da il seguente errore:
    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'rs'
    /public/pannello/Form_Modifica_Agenzia.asp, line 239 ```
    <%
    age= Trim(Request.QueryString("age"))
    dim conn2
    set conn2=server.CreateObject("ADODB.Connection")
    Conn2.Open "driver={Microsoft Access Driver (.mdb)};dbq="& server.MapPath("/mdb-database/immobile.mdb")
    sql="select * from da_vendere where codice='"&age&"'"
    set rs=conn2.execute(sql)
    %>
    <!--#include file="upload.asp"-->
    <%
    If Request.QueryString("Save")="1" then
    Dim oUpload
    Set oUpload = new cUpload
    oUpload.AutoRename = True
    oUpload.Overwrite = False
    oUpload.SetPath "public/Immobili" 'Impostazione del percorso
    oUpload.Load
    While Not oUpload.EOF
    oUpload.Save()
    Select Case lCase(oUpload.Files("InputName"))
    Case "img1"
    FileName_img1= oUpload.GetFileName()
    Case "img2"
    FileName_img2= oUpload.GetFileName()
    Case "img3"
    FileName_img3= oUpload.GetFileName()
    Case "img4"
    FileName_img4= oUpload.GetFileName()
    Case "img5"
    FileName_img5= oUpload.GetFileName()
    Case "img6"
    FileName_img6= oUpload.GetFileName()
    Case "img7"
    FileName_img7= oUpload.GetFileName()
    Case "img8"
    FileName_img8= oUpload.GetFileName()
    Case "img9"
    FileName_img9= oUpload.GetFileName()
    Case "img10"
    FileName_img10= oUpload.GetFileName()
    Case "img11"
    FileName_img11= oUpload.GetFileName()
    Case "img12"
    FileName_img12= oUpload.GetFileName()
    Case "img13"
    FileName_img13= oUpload.GetFileName()
    Case "img14"
    FileName_img14= oUpload.GetFileName()
    Case "img15"
    FileName_img15= oUpload.GetFileName()
    Case "img16"
    FileName_img16= oUpload.GetFileName()
    Case "img17"
    FileName_img17= oUpload.GetFileName()
    Case "img18"
    FileName_img18= oUpload.GetFileName()
    Case "img19"
    FileName_img19= oUpload.GetFileName()
    Case "img20"
    FileName_img20= oUpload.GetFileName()
    End Select
    oUpload.MoveNext
    Wend
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "DRIVER={Microsoft Access Driver (
    .mdb)};DBQ=" & Server.MapPath("/mdb-database/Immobile.mdb")
    Set Rs=server.CreateObject("ADODB.Recordset")
    id= oUpload.Form("id")
    SQL="select * from da_vendere where id= "& id &";"
    rs.open SQL, conn, 3, 3
    Rs.Update
    Rs("localita") = oUpload.Form("localita")
    Rs("codice") = oUpload.Form("codice")
    Rs("contratto") = oUpload.Form("contratto")
    Rs("prezzo") = oUpload.Form("prezzo")
    Rs("vani") = oUpload.Form("vani")
    Rs("provincia") = oUpload.Form("mq")
    Rs("comune") = oUpload.Form("comune")
    Rs("tipologia") = oUpload.Form("tipologia")
    Rs("piano") = oUpload.Form("piano")
    Rs("anno") = oUpload.Form("anno")
    Rs("postoauto") = oUpload.Form("postoauto")
    Rs("cucina") = oUpload.Form("cucina")
    Rs("letti") = oUpload.Form("letti")
    Rs("bagni") = oUpload.Form("bagni")
    Rs("cantina") = oUpload.Form("cantina")
    Rs("terrazzi") = oUpload.Form("terrazzi")
    Rs("mq") = oUpload.Form("mq")
    Rs("zonagiorno") = oUpload.Form("zonagiorno")
    Rs("angolocottura") = oUpload.Form("angolocottura")
    Rs("letti") = oUpload.Form("letti")
    Rs("giardino") = oUpload.Form("giardino")
    Rs("box") = oUpload.Form("box")
    Rs("piscina") = oUpload.Form("piscina")
    Rs("descrizione") = oUpload.Form("descrizione")
    Rs("image2") = oUpload.Form("image2")
    Rs("image3") = oUpload.Form("image3")
    Rs("image4") = oUpload.Form("image4")
    Rs("image5") = oUpload.Form("image5")
    Rs("image6") = oUpload.Form("image6")
    Rs("image7") = oUpload.Form("image7")
    Rs("image8") = oUpload.Form("image8")
    Rs("image9") = oUpload.Form("image9")
    Rs("image10") = oUpload.Form("image10")
    Rs("image11") = oUpload.Form("image11")
    Rs("image12") = oUpload.Form("image12")
    Rs("image13") = oUpload.Form("image13")
    Rs("image14") = oUpload.Form("image14")
    Rs("image15") = oUpload.Form("image15")
    Rs("image16") = oUpload.Form("image16")
    Rs("image17") = oUpload.Form("image17")
    Rs("image18") = oUpload.Form("image18")
    Rs("image19") = oUpload.Form("image19")
    Rs("image20") = oUpload.Form("image20")

    Rs("img1") = FileName_img1
    if Rs("img1") <> " " then
    Rs("Image1")= FileName_img1
    end if
    Rs("img2") = FileName_img2
    if Rs("img2") <> " " then
    Rs("Image2")= FileName_img2
    end if
    Rs("img3") = FileName_img3
    if Rs("img3") <> " " then
    Rs("Image3")= FileName_img3
    end if
    Rs("img4") = FileName_img4
    if Rs("img4") <> " " then
    Rs("Image4")= FileName_img4
    end if
    Rs("img5") = FileName_img5
    if Rs("img5") <> " " then
    Rs("Image5")= FileName_img5
    end if
    Rs("img6") = FileName_img6
    if Rs("img6") <> " " then
    Rs("Image6")= FileName_img6
    end if
    Rs("img7") = FileName_img7
    if Rs("img7") <> " " then
    Rs("Image7")= FileName_img7
    end if
    Rs("img8") = FileName_img8
    if Rs("img8") <> " " then
    Rs("Image8")= FileName_img8
    end if
    Rs("img9") = FileName_img9
    if Rs("img9") <> " " then
    Rs("Image9")= FileName_img9
    end if
    Rs("img10") = FileName_img10
    if Rs("img10") <> " " then
    Rs("Image10")= FileName_img10
    end if
    Rs("img11") = FileName_img11
    if Rs("img11") <> " " then
    Rs("Image11")= FileName_img11
    end if
    Rs("img12") = FileName_img12
    if Rs("img12") <> " " then
    Rs("Image12")= FileName_img12
    end if
    Rs("img13") = FileName_img13
    if Rs("img13") <> " " then
    Rs("Image13")= FileName_img13
    end if
    Rs("img14") = FileName_img14
    if Rs("img14") <> " " then
    Rs("Image14")= FileName_img14
    end if
    Rs("img15") = FileName_img15
    if Rs("img15") <> " " then
    Rs("Image15")= FileName_img15
    end if
    Rs("img16") = FileName_img16
    if Rs("img16") <> " " then
    Rs("Image16")= FileName_img16
    end if
    Rs("img17") = FileName_img17
    if Rs("img17") <> " " then
    Rs("Image17")= FileName_img17
    end if
    Rs("img18") = FileName_img18
    if Rs("img18") <> " " then
    Rs("Image18")= FileName_img18
    end if
    Rs("img19") = FileName_img19
    if Rs("img19") <> " " then
    Rs("Image19")= FileName_img19
    end if
    Rs("img20") = FileName_img20
    if Rs("img20") <> " " then
    Rs("Image20")= FileName_img20
    end if

    Rs.update
    Rs.Close
    Conn.Close
    Set Rs = Nothing
    Set Conn=Nothing
    Set oUpload = Nothing
    End if
    %>

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Modifica dati immobile</title>
    <link rel="stylesheet" href="../sh.css" type="text/css">
    </head>
    <body bgcolor="#FFFFFF">
    <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="700" bgcolor="#FFFFFF" height="501" background="sfondo1.jpg" style="border-collapse: collapse" bordercolor="#111111">
    <tr>
    <td height="58" colspan="2" width="700">
    <p align="center" style="margin-top: 1; margin-bottom: 1"><u><b> <font face="Verdana" size="4" color="#0000FF">Pannello
    Modifica Dati Immobile</font></b></u></td>
    </tr>
    </center>
    <tr>
    <td background="../img/sfondo.gif" height="389" colspan="2">
    <blockquote>
    <p align="justify" style="margin-top: 0; margin-bottom: 0"><font size="2">
    Da questo pannello è possibile modificare i dati dell'Immobile selezionato.
    I campi contrassegnati con <font color="#FF0000">*</font> sono obbligatori
    . </font>
    <p align="justify" style="margin-top: 0; margin-bottom: 0"> </blockquote>
    <form name="form1" method="post" enctype="multipart/form-data" action="?save=1"><div align="left">
    <input type="hidden" name="id" value="<%=rs("id")%>">
    <input type="hidden" name="image1" value="<%=rs("image1")%>">
    <input type="hidden" name="image2" value="<%=rs("image2")%>">
    <input type="hidden" name="image3" value="<%=rs("image3")%>">
    <input type="hidden" name="image4" value="<%=rs("image4")%>">
    <input type="hidden" name="image5" value="<%=rs("image5")%>">
    <input type="hidden" name="image6" value="<%=rs("image6")%>">
    <input type="hidden" name="image7" value="<%=rs("image7")%>">
    <input type="hidden" name="image8" value="<%=rs("image8")%>">
    <input type="hidden" name="image9" value="<%=rs("image9")%>">
    <input type="hidden" name="image10" value="<%=rs("image10")%>">
    <input type="hidden" name="image11" value="<%=rs("image11")%>">
    <input type="hidden" name="image12" value="<%=rs("image12")%>">
    <input type="hidden" name="image13" value="<%=rs("image13")%>">
    <input type="hidden" name="image14" value="<%=rs("image14")%>">
    <input type="hidden" name="image15" value="<%=rs("image15")%>">
    <input type="hidden" name="image16" value="<%=rs("image16")%>">
    <input type="hidden" name="image17" value="<%=rs("image17")%>">
    <input type="hidden" name="image18" value="<%=rs("image18")%>">
    <input type="hidden" name="image19" value="<%=rs("image19")%>">
    <input type="hidden" name="image20" value="<%=rs("image20")%>">

            <table border="0" cellpadding="0" cellspacing="0" width="700" height="521" style="border-collapse: collapse" bordercolor="#111111">
              <!--DWLayoutTable-->
              <tr> 
                <td width="114" valign="top" align="right" height="31"> <p align="right"><b>Localita:&nbsp; 
                    </b> </td>
                <td width="238" valign="top"> <p align="left"> 
                    <input type="text" name="localita" size="32" value="<%=rs("localita")%>" id="<%=rs("localita")%>">
                    <font color="#FF0000">*</font> </td>
                <td colspan="2" align="right" valign="top"> <p align="right"><b>Cucina:&nbsp; 
                    </b> </td>
                <td width="213" valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="cucina" size="32" value="<%=rs("cucina")%>" id="<%=rs("cucina")%>">
                  </font></b></td>
                <td width="11"></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Codice:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="codice" size="32" value="<%=rs("codice")%>" id="<%=rs("codice")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>Letto: &nbsp; </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="letti" size="32" value="<%=rs("letti")%>" id="<%=rs("letti")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Contratto:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="contratto" size="32" value="<%=rs("contratto")%>" id="<%=rs("contratto")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Bagno: &nbsp; </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="bagni" size="32" value="<%=rs("bagni")%>" id="<%=rs("bagni")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b> Prezzo:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="prezzo" size="32" value="<%=rs("prezzo")%>" id="<%=rs("prezzo")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>Cantina: &nbsp; 
                  </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="cantina" size="32" value="<%=rs("cantina")%>" id="<%=rs("cantina")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="30"><b>Vani:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="vani" size="32" value="<%=rs("vani")%>" id="<%=rs("vani")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Terrazzo: &nbsp; 
                  </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="terrazzi" size="32" value="<%=rs("terrazzi")%>" id="<%=rs("terrazzi")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Provincia:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="provincia" size="32" value="<%=rs("provincia")%>" id="<%=rs("provincia")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"> <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  Mq: &nbsp; </b></td>
                <td valign="top"> <b><font color="#FF0000"> 
                  <input type="text" name="mq" size="32" value="<%=rs("mq")%>" id="<%=rs("mq")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="29"><b>Comune:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="comune" size="32" value="<%=rs("comune")%>" id="<%=rs("comune")%>"> 
                </td>
                <td colspan="2" align="right" valign="top" nowrap> <p align="right"><b>Zona 
                    Giorno:</b>&nbsp; </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="zonagiorno" size="32" value="<%=rs("zonagiorno")%>" id="<%=rs("zonagiorno")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Piano: &nbsp;</b></td>
                <td valign="top"> <input type="text" name="piano" size="32" value="<%=rs("piano")%>" id="<%=rs("piano")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Giardino: &nbsp; 
                  </b> </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="giardino" size="32" value="<%=rs("giardino")%>" id="<%=rs("giardino")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Anno: &nbsp;</b></td>
                <td valign="top"> <input type="text" name="anno" size="32" value="<%=rs("anno")%>" id="<%=rs("anno")%>"> 
                </td>
                <td colspan="2" align="right" valign="top">&nbsp;&nbsp; <b>Box: 
                  &nbsp; </b></td>
                <td valign="top"> <input type="text" name="box" size="32" value="<%=rs("box")%>" id="<%=rs("box")%>"> 
                </td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Posto auto : &nbsp;</b></td>
                <td align="left" valign="top"> <input type="text" name="postoauto" size="32" value="<%=rs("postoauto")%>" id="<%=rs("postoauto")%>"> 
                </td>
                <td colspan="2" align="right" valign="top">&nbsp;&nbsp; <b>Piscina: 
                  &nbsp; </b></td>
                <td valign="top"> <input type="text" name="box" size="32" value="<%=rs("piscina")%>" id="<%=rs("piscina")%>"> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>&nbsp;Tipologia:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="tipologia" size="32" value="<%=rs("tipologia")%>" id="<%=rs("tipologia")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>An. Cottura: &nbsp; 
                  </b> </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="angolocottura" size="32" value="<%=rs("angolocottura")%>" id="<%=rs("angolocottura")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="150" align="right" valign="top"><b>Descrizione : &nbsp;</b></td>
                <td colspan="2" align="left" valign="top"> <textarea rows="8" name="descrizione" cols="38"><%=rs("descrizione")%></textarea> 
                </td>
                <td width="99"><!--DWLayoutEmptyCell-->&nbsp;</td>
                <td><!--DWLayoutEmptyCell-->&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                  <td height="25" align="right" valign="top"><b>Img2: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img2" type="file" id="img2" >
                    </font> 
                  </td>
                  <td width="99"><b>Img3 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img3" type="file" id="img3" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img4: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img4" type="file" id="img4" >
                    </font> 
                  </td>
                  <td width="99"><b>Img5 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img5" type="file" id="img5" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img6: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img6" type="file" id="img6" >
                    </font> 
                  </td>
                  <td width="99"><b>Img7 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img7" type="file" id="img7" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img8: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img8" type="file" id="img8" >
                     </font> 
                  </td>
                  <td width="99"><b>Img9 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img9" type="file" id="img9" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img10: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img10" type="file" id="img10" >
                    </font> 
                  </td>
                  <td width="99"><b>Img11 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img11" type="file" id="img11" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img12: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img12" type="file" id="img12" >
                    </font> 
                  </td>
                  <td width="99"><b>Img13 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img13" type="file" id="img13" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img14: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img14" type="file" id="img14" >
                    </font> 
                  </td>
                  <td width="99"><b>Img15 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img15" type="file" id="img15" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img16: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img16" type="file" id="img16" >
                    </font> 
                  </td>
                  <td width="99"><b>Img17 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img17" type="file" id="img17" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img18: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img18" type="file" id="img18" >
                    </font> 
                  </td>
                  <td width="99"><b>Img19 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img19" type="file" id="img19" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img20: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img20" type="file" id="img20" >
                    </font> 
                  </td>
                  <td width="99"><b>Img1:</b></td>
                  <td><input name="img1" type="file" id="img1" ></td>
                  <td>&nbsp;</td>
                </tr>
     <table width="700" height="325" border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse" dwcopytype="CopyTableCell">
              </table>
              <tr> 
                <td height="33"></td>
                <td></td>
                <td colspan="2">&nbsp;&nbsp; <input type="submit" value="invia i dati" name="pulsante" style="float: right"></td>
                <td align="center"> <p align="center">&nbsp; 
                    <input type="reset" value="Reimposta" name="reset" style="float: left">
                </td>
                <td></td>
              </tr>
              <tr>
                <td height="1"></td>
                <td></td>
                <td width="25"></td>
                <td></td>
                <td></td>
                <td></td>
              </tr>
            </table>
        </div>
        </form>
        </td>
    </tr>
    <tr>
      <td height="35" valign="bottom" width="270">&nbsp;</td>
      <td height="35" valign="bottom" width="430">&nbsp;</td>
    </tr>
    <tr>
      <td height="19" valign="bottom" width="700" colspan="2">
      <p align="center">&nbsp; [
    

    <a href="Partners.asp">Indietro</a> ]</td>
    </tr>
    </table>
    </div>
    </body>
    </html>

    L'errore è sulla linea segnalata in rosso
    Non riesco a risolvere questo errore

  • User

    il problema è che stai cercando di usare il valore estratto dal database direttamente usando "rs", ma per utilizzarlo così dovrebbe essere all'interno del ciclo con il quale estrai i dati....altrimenti se fai il ciclo prima, devi assegnare il valore ad una variabile, e poi la riutilizzi...


  • User Newbie

    Io quando visualizzo la pagina mi importa i dati correttamente, quando invece eseguo l'aggiornamento del form che mi da quel errore però faccendo il refresh alle pagine le modifiche apportate ci sono


  • User

    nella tua FORM chiamata Form1, dovresti avere i dati estratti dal database che corrispondono all'id del record, che tu invii alla pagina trmite querystring...o form...giusto?

    Ma come hai messo tu i dati all'interno della form, cioè richiamando direttamente rs("nomedelcampo"), dovresti avere prima dell'apertura della form l'inizio del ciclo che estrae il record corrispondente, quindi con la sql tipo select * from tabella where id="&tuoid&"....poi nel ciclo che aprirai con ad esempio

    while not rs.eof

    usi i dati direttamente con <%=rs("nomedelcampo")%>

    poi chiudi il ciclo

    wend

    allora dovrebbe funzionare...

    Altrimenti dovresti avere il ciclo prima e assegnare i valori alle variabili tipo:

    while not rs.eof
    nomecampo=rs("nomecampo")
    wend

    e poi puoi fare la form mettendo <input type="text" name="nomecampo" value="<%=nomecampo%> />

    ecc...


  • User Newbie
    
    <%
    age= Trim(Request.QueryString("age"))
    dim conn2
    set conn2=server.CreateObject("ADODB.Connection")
    Conn2.Open "driver={Microsoft Access Driver (*.mdb)};dbq="& server.MapPath("/mdb-database/immobile.mdb")
    sql="select * from da_vendere where codice='"&age&"'"
    set rs=conn2.execute(sql)
    while not rs.eof
    %>
      <form name="form1" method="post" enctype="multipart/form-data" action="?save=1"><div align="left">
              <input type="hidden" name="id" value="<%=rs("id")%>">.........
     
     
    .......</div>
            </form>
    <% wend %>
    
    

    Ciao Ale_76 ho provato o almeno credo a fare quello che mi ha i detto tu ma ora mi da questo errore:

    Response object error 'ASP 0251 : 80004005'
    Response Buffer Limit Exceeded
    /public/pannello/Form_Modifica_Agenzia.asp, line 0
    Execution of the ASP page caused the Response Buffer to exceed its configured limit.


  • User

    no aspetta...ma hai messo la form prima dell'html?
    tu hai l'errore alla riga 239...dove hai appena aperto la form...tu è l'ì che devi mettere il ciclo...prima di <form name="form1"..ecc... e dopo </form>

    devi mettere qualcosa tipo:

    <%
    Set MyConn=Server.CreateObject("ADODB.Connection")
    MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.Mappath("/mdb-database/immobile.mdb")

    SQL = "select * from da_vendere where id= "& id &" "
    Set RS = MyConn.Execute(SQL)
    While Not RS.EOF
    %>

    <form name="form1" method="post" enctype="multipart/form-data" action="?save=1"><div align="left">
    <input type="hidden" name="id" value="<%=rs("id")%>">
    <input type="hidden" name="image1" value="<%=rs("image1")%>">
    <input type="hidden" name="image2" value="<%=rs("image2")%>">
    <input type="hidden" name="image3" value="<%=rs("image3")%>">
    <input type="hidden" name="image4" value="<%=rs("image4")%>">
    <input type="hidden" name="image5" value="<%=rs("image5")%>">
    <input type="hidden" name="image6" value="<%=rs("image6")%>">
    <input type="hidden" name="image7" value="<%=rs("image7")%>">
    <input type="hidden" name="image8" value="<%=rs("image8")%>">
    <input type="hidden" name="image9" value="<%=rs("image9")%>">
    <input type="hidden" name="image10" value="<%=rs("image10")%>">
    <input type="hidden" name="image11" value="<%=rs("image11")%>">
    <input type="hidden" name="image12" value="<%=rs("image12")%>">
    <input type="hidden" name="image13" value="<%=rs("image13")%>">
    <input type="hidden" name="image14" value="<%=rs("image14")%>">
    <input type="hidden" name="image15" value="<%=rs("image15")%>">
    <input type="hidden" name="image16" value="<%=rs("image16")%>">
    <input type="hidden" name="image17" value="<%=rs("image17")%>">
    <input type="hidden" name="image18" value="<%=rs("image18")%>">
    <input type="hidden" name="image19" value="<%=rs("image19")%>">
    <input type="hidden" name="image20" value="<%=rs("image20")%>">

            <table border="0" cellpadding="0" cellspacing="0" width="700" height="521" style="border-collapse: collapse" bordercolor="#111111">
              <!--DWLayoutTable-->
              <tr> 
                <td width="114" valign="top" align="right" height="31"> <p align="right"><b>Localita:&nbsp; 
                    </b> </td>
                <td width="238" valign="top"> <p align="left"> 
                    <input type="text" name="localita" size="32" value="<%=rs("localita")%>" id="<%=rs("localita")%>">
                    <font color="#FF0000">*</font> </td>
                <td colspan="2" align="right" valign="top"> <p align="right"><b>Cucina:&nbsp; 
                    </b> </td>
                <td width="213" valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="cucina" size="32" value="<%=rs("cucina")%>" id="<%=rs("cucina")%>">
                  </font></b></td>
                <td width="11"></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Codice:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="codice" size="32" value="<%=rs("codice")%>" id="<%=rs("codice")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>Letto: &nbsp; </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="letti" size="32" value="<%=rs("letti")%>" id="<%=rs("letti")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Contratto:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="contratto" size="32" value="<%=rs("contratto")%>" id="<%=rs("contratto")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Bagno: &nbsp; </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="bagni" size="32" value="<%=rs("bagni")%>" id="<%=rs("bagni")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b> Prezzo:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="prezzo" size="32" value="<%=rs("prezzo")%>" id="<%=rs("prezzo")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>Cantina: &nbsp; 
                  </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="cantina" size="32" value="<%=rs("cantina")%>" id="<%=rs("cantina")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="30"><b>Vani:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="vani" size="32" value="<%=rs("vani")%>" id="<%=rs("vani")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Terrazzo: &nbsp; 
                  </b></td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="terrazzi" size="32" value="<%=rs("terrazzi")%>" id="<%=rs("terrazzi")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="31"><b>Provincia:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="provincia" size="32" value="<%=rs("provincia")%>" id="<%=rs("provincia")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"> <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  Mq: &nbsp; </b></td>
                <td valign="top"> <b><font color="#FF0000"> 
                  <input type="text" name="mq" size="32" value="<%=rs("mq")%>" id="<%=rs("mq")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td valign="top" align="right" height="29"><b>Comune:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="comune" size="32" value="<%=rs("comune")%>" id="<%=rs("comune")%>"> 
                </td>
                <td colspan="2" align="right" valign="top" nowrap> <p align="right"><b>Zona 
                    Giorno:</b>&nbsp; </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="zonagiorno" size="32" value="<%=rs("zonagiorno")%>" id="<%=rs("zonagiorno")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Piano: &nbsp;</b></td>
                <td valign="top"> <input type="text" name="piano" size="32" value="<%=rs("piano")%>" id="<%=rs("piano")%>"> 
                </td>
                <td colspan="2" align="right" valign="top"><b>Giardino: &nbsp; 
                  </b> </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="giardino" size="32" value="<%=rs("giardino")%>" id="<%=rs("giardino")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Anno: &nbsp;</b></td>
                <td valign="top"> <input type="text" name="anno" size="32" value="<%=rs("anno")%>" id="<%=rs("anno")%>"> 
                </td>
                <td colspan="2" align="right" valign="top">&nbsp;&nbsp; <b>Box: 
                  &nbsp; </b></td>
                <td valign="top"> <input type="text" name="box" size="32" value="<%=rs("box")%>" id="<%=rs("box")%>"> 
                </td>
                <td></td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>Posto auto : &nbsp;</b></td>
                <td align="left" valign="top"> <input type="text" name="postoauto" size="32" value="<%=rs("postoauto")%>" id="<%=rs("postoauto")%>"> 
                </td>
                <td colspan="2" align="right" valign="top">&nbsp;&nbsp; <b>Piscina: 
                  &nbsp; </b></td>
                <td valign="top"> <input type="text" name="box" size="32" value="<%=rs("piscina")%>" id="<%=rs("piscina")%>"> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td height="31" align="right" valign="top"><b>&nbsp;Tipologia:&nbsp;&nbsp; 
                  </b></td>
                <td valign="top"> <input type="text" name="tipologia" size="32" value="<%=rs("tipologia")%>" id="<%=rs("tipologia")%>"> 
                  <font color="#FF0000">*</font></td>
                <td colspan="2" align="right" valign="top"><b>An. Cottura: &nbsp; 
                  </b> </td>
                <td valign="top"><b><font color="#FF0000"> 
                  <input type="text" name="angolocottura" size="32" value="<%=rs("angolocottura")%>" id="<%=rs("angolocottura")%>">
                  </font></b></td>
                <td></td>
              </tr>
              <tr> 
                <td height="150" align="right" valign="top"><b>Descrizione : &nbsp;</b></td>
                <td colspan="2" align="left" valign="top"> <textarea rows="8" name="descrizione" cols="38"><%=rs("descrizione")%></textarea> 
                </td>
                <td width="99"><!--DWLayoutEmptyCell-->&nbsp;</td>
                <td><!--DWLayoutEmptyCell-->&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr> 
                  <td height="25" align="right" valign="top"><b>Img2: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img2" type="file" id="img2" >
                    </font> 
                  </td>
                  <td width="99"><b>Img3 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img3" type="file" id="img3" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img4: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img4" type="file" id="img4" >
                    </font> 
                  </td>
                  <td width="99"><b>Img5 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img5" type="file" id="img5" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img6: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img6" type="file" id="img6" >
                    </font> 
                  </td>
                  <td width="99"><b>Img7 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img7" type="file" id="img7" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img8: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img8" type="file" id="img8" >
                     </font> 
                  </td>
                  <td width="99"><b>Img9 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img9" type="file" id="img9" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img10: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img10" type="file" id="img10" >
                    </font> 
                  </td>
                  <td width="99"><b>Img11 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img11" type="file" id="img11" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img12: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img12" type="file" id="img12" >
                    </font> 
                  </td>
                  <td width="99"><b>Img13 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img13" type="file" id="img13" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img14: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img14" type="file" id="img14" >
                    </font> 
                  </td>
                  <td width="99"><b>Img15 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img15" type="file" id="img15" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img16: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img16" type="file" id="img16" >
                    </font> 
                  </td>
                  <td width="99"><b>Img17 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img17" type="file" id="img17" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img18: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img18" type="file" id="img18" >
                    </font> 
                  </td>
                  <td width="99"><b>Img19 :</b></td>
                  <td><font color="#000080" face="Verdana">
                    <input name="img19" type="file" id="img19" >
                    </font></td>
                  <td>&nbsp;</td>
                </tr>
    <tr> 
                  <td height="24" align="right" valign="top"><b>Img20: &nbsp;</b></td>
                  <td colspan="2" align="left" valign="top"><font color="#000080" face="Verdana">
                    <input name="img20" type="file" id="img20" >
                    </font> 
                  </td>
                  <td width="99"><b>Img1:</b></td>
                  <td><input name="img1" type="file" id="img1" ></td>
                  <td>&nbsp;</td>
                </tr>
     <table width="700" height="325" border="0" cellpadding="0" cellspacing="0" bordercolor="#111111" style="border-collapse: collapse" dwcopytype="CopyTableCell">
              </table>
              <tr> 
                <td height="33"></td>
                <td></td>
                <td colspan="2">&nbsp;&nbsp; <input type="submit" value="invia i dati" name="pulsante" style="float: right"></td>
                <td align="center"> <p align="center">&nbsp; 
                    <input type="reset" value="Reimposta" name="reset" style="float: left">
                </td>
                <td></td>
              </tr>
              <tr>
                <td height="1"></td>
                <td></td>
                <td width="25"></td>
                <td></td>
                <td></td>
                <td></td>
              </tr>
            </table>
        </div>
        </form>
    

    <%
    RS.MoveNext
    Wend
    RS.Close
    Set RS = Nothing

    MyConn.Close
    Set MyConn = Nothing
    %>


  • User Newbie

    Grazie Ale ho risolto tutto ti ringrazio ora va che è un piacere.:yuppi:
    Comunque giusto per saperlo è lo script di baol modificato per fare gli aggiornamenti dati e foto