salve a tutti, è da un po che cerco di mandare dei dati da un form html ad un database access molto semplice.
Ho gia fatto i tre file utili per questo.
1 ho creato una pagina html così:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pagina1</title>
</head>
<body>
<form method="POST" action="inserisci.asp">
nome<input type="text"
name="nome" size="20"></p>
cognome<input type="text"
name="cognome" size="20"></p>
telefono<input type="text"
name="telefono" size="20"></p>
<input type="submit" value="Invia"
name="x"></p>
</form>
</body>
</html>
poi ho creato il database che contiene una tabella chiamata Tabella1 e 3 campi chiamati a, b, c
e infine ho fatto la pagina chiamata inserisci.asp con il seguente codice
<%@LANGUAGE="VBSCRIPT"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>inserisci</title>
</head>
<body>
<%
a=request.form("nome")
b=request.form("cognome")
c=request.form("telefono")
set conn=server.createobject("ADODB.connection")
conn.open "driver={Microsoft Access Driver(*.mdb)}; dbq="& server.mappath("db.mdb")
stringa="insert into Tabella1 (a,b,c) values('"& a &"','"& b &"','"& c &"')"
conn.execute(stringa)
response.write("REGISTRAZIONE ESEGUITA")
conn.close
set conn=nothing
%>
</body>
</html>
in teoria dovrebbe essere tutto corretto solo che quando carico sull' host il tutto e vado all' indirizzo, mi fa riempire i campi del form e quando invio mi da questo errore
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/c/r/i/cristyle/inserisci.asp, line 15
non so proprio cosa fare, qualcuno può aiutarmi? un grazie anticipato.