Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2002
    Messaggi
    9

    Errore 800a0401 chiedo assistenza

    <%
    if request("id")=1 then
    on error resume next
    dim strQuery
    strQuery="INSERT INTO Tblgiorno("
    dim strValori
    strValori=" VALUES("
    dim strSql
    strSql=""

    for each item in request.form
    if item<>"Submit" then
    strQuery= strQuery &; item &;"," <---questa è la riga per la quale mi da errore, precisamente sul primo ;
    strValori= strValori &; "'"&amp;server.HTMLEncode(request.form(item))&;"', "
    end if
    next

    strQuery=mid(strQuery,1,len(strQuery)-1) &;")"
    strValori=mid(strValori,1,len(strValori)-1) &;")"

    set rs =server.createObject("ADODB.Recordset")
    strConn="driver={Microsoft Access Driver (.mdb)}; "
    strConn=strConn &; " DBQ=" &; Server.MapPath("mdb-database/elenco.mdb")
    strSql= strQuery &; strValori
    rs.open strSql,strConn
    set rs=nothing
    if err.number<>0 then
    response.write err.number &;"
    "&;err.description
    else
    response.write "inserimento avvenuto con successo"
    end if

    response.end
    end if
    %>
    <form method="post" action="script.asp?id=1">
    <input type="text" name="ID">

    <input type="text" name="Nome">

    <input type="text" name="Cognome">

    <input type="text" name="Data">

    <input type="text" name="Ora">

    <input type="text" name="Tipo">

    <input type="text" name="Paese">


    <input type="submit" name="Submit" value="Invia">
    </form>

    Sto cercando di aggiungere un record sul mio db direttamente da un form, ho preso lo script presente sul sito, ma mi da quell'errore e non riesco ad andare avanti
    spero un un vostro aiuto
    grazie

  2. #2
    dopo il simbolo & il punto-e-virgola nuoce assai -- toglilo

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2002
    Messaggi
    9
    grazie optime, tutto risolto va che una meraviglia

    a presto
    Cleante

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.