Originariamente inviato da serialkiller
mi da un errore diverso
questo è il codice, kosa sbaglio adesso, ho omesso qualke dato ?codice:<% if request("id")=1 then on error resume next dim strQuery strQuery="INSERT INTO io(" dim strValori strValori=" VALUES(" dim strSql strSql="" for each item in request.form if item<>"Submit" then strQuery= strQuery & item &"," strValori= strValori & "'"&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("database.mdb") strSql= strQuery & strValori rs.open strSql,strConn 'qui il secondo parametro deve essere una connessione 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="index.asp?id=1"> <input type="text" name="foto"> <input type="text" name="via"> <input type="text" name="descrizione"> <input type="submit" name="Submit" value="Invia"> </form>
la pagina si kiama "index.asp"
il db si kiama "database.mdb"
la tabella si kiama "io"
errore
scusamicodice:-2147467259 [Microsoft][ODBC Driver Manager] Nome origine dati non trovato e driver predefinito non specificato.![]()