Ho la mia pagina creata e salvata in .asp
<html>
<head>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nome</title>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--">
</p>
Nome
<input type="text" name="T1" size="20"></p>
Cognome <input type="text" name="T2" size="20"></p>
Indirizzo
<input type="text" name="T3" size="20"></p>
<input type="submit" value="Invia" name="B1"></p>
</p>
</form>
</body>
</html>
In rete ho trovato un esempio e l'ho adattato.
Il mio problema è il seguente...come faccio ad abbinare il codice qui sotto alla pressione del pulsante????
' Definizione della variabile
dim strNome
strNome = request.form("nome")
dim strCognome
strCognome = request.form("cognome")
dim strIndirizzo
strIndirizzo = request.form("indirizzo")
dim strCode
strCode="innovatel"
' Mappaggio del database
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("archivio.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn
' Stringa di interrogazione sulla tabella libri
sql = "SELECT * FROM utenti"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3
' Preparazione e scrittura nuovo record
rs.addnew
rs(1) = strNome
rs(2) = strCognome
rs(3) = strIndirizzo
rs.update
' Chiusura del database
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
%>
Ciao e grazieeeeeeeee


Rispondi quotando