1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <%
SQLQuery= "INSERT INTO test (Nom, Prenom, Age) "
SQLQuery= SQLQuery & "VALUES( '" & Request("Nom") & "','"& Request("Prenom")& "','" & Request("Age") & "')"
Set oConn = Server.CreateObject("ADODB.Connection") 'Création d'une instance
oConn.Open "dsn=poo" 'Ouverture de la connection
oConn.Execute(SQLQuery) 'Exécution de la requête
oConn.close 'Fermeture de la connection
%>
<body>
<table>
<tr>
<td valign="top" bgcolor="#FFFFFF">
<CENTER>
<form method="POST">
<H2>Ajouter un enregistrement</H2>
<BR>
<table>
<tr>
<td>Nom: </td>
<td>
<input type="text" name="Nom" size="20"
value="<%=Request.Form("Nom")%>">
</td>
</tr>
<tr>
<td>Prénom: </td>
<td>
<input type="text" name="Prenom" size="20"
value="<%=Request.form("Prenom")%>">
</td>
</tr>
<tr>
<td>Age: </td>
<td>
<INPUT TYPE="text" NAME="Age" SIZE="20" VALUE="<%=Request.form("Age")%>">
</td>
</tr>
</table>
<p>
<input type="submit" value="ENVOYER" name="Envoyer">
</p>
</form>
</center>
</td>
</table>
</body>
</html> |
Partager