Bonjour,
Je n'arrive pas à rajuster un enregistrement à ma base de données Access à l'aide du formulaire dont le code se trouve ci-dessous.
Merci pour votre aide
Michèle
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<title></title>
</head>
<body bgcolor="#ffffe1">
<p align="center">
<br><b><font size="5" face="Book Antiqua" color="#000080"> Inscription compétiteur</font></b> </p><!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.Classement.selectedIndex < 0)
{
alert("Sélectionnez une des options \"Classement\".");
theForm.Classement.focus();
return (false);
}
var numSelected = 0;
var i;
for (i = 0; i < theForm.Classement.length; i++)
{
if (theForm.Classement.options[i].selected)
numSelected++;
}
if (numSelected > 50)
{
alert("Sélectionnez au plus 50 des \"Classement\" options.");
theForm.Classement.focus();
return (false);
}
if (theForm.Licence.value == "")
{
alert("Tapez une valeur pour le champ \"Licence\".");
theForm.Licence.focus();
return (false);
}
if (theForm.Licence.value.length > 50)
{
alert("Tapez au plus 50 caractères dans le champ \"Licence\".");
theForm.Licence.focus();
return (false);
}
var radioSelected = false;
for (i = 0; i < theForm.Sexe.length; i++)
{
if (theForm.Sexe[i].checked)
radioSelected = true;
}
if (!radioSelected)
{
alert("Sélectionnez une des options \"Sexe\".");
return (false);
}
if (theForm.MotDePasse.value == "")
{
alert("Tapez une valeur pour le champ \"MotDePasse\".");
theForm.MotDePasse.focus();
return (false);
}
if (theForm.MotDePasse.value.length > 50)
{
alert("Tapez au plus 50 caractères dans le champ \"MotDePasse\".");
theForm.MotDePasse.focus();
return (false);
}
return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="post" action="AjoutCompétiteur.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<center>
<table border="1" width="270" height="1" cellspacing="1">
<tr>
<td height="19" width="297" colspan="2" bgcolor="#000080">
<p align="center"><font color="white">Inscription compétiteur</font></p></td>
</tr>
<tr>
<td height="19" width="130" bgcolor="#ffffd7"> Nom</td>
<td height="19" width="167" bgcolor="#ffffd7"><input name="Nom"></td>
</tr>
<tr>
<td height="17" width="130" bgcolor="#ffffd7">Prénom</td>
<td height="17" width="167" bgcolor="#ffffd7"><input name="Prenom"></td>
</tr>
<tr>
<td height="19" width="130" bgcolor="#ffffd7">Classement</td>
<td height="19" width="167" bgcolor="#ffffd7"><!--webbot bot="Validation" B-Value-Required="TRUE" I-Maximum-Length="50" --><select name="Classement"> <option value="0" selected>NC</option> <option value="5">30/5</option> <option value="10">30/4</option> <option value="20">30/3</option> <option value="30">30/2</option> <option value="50">30/1</option> <option value="80">30</option> <option value="120">15/5</option> <option value="160">15/4</option> <option value="200">15/3</option> <option value="240">15/2</option> <option value="280">15/1</option> <option value="330">15</option> <option value="370">5/6</option> <option value="410">4/6</option> <option value="450">3/6</option> <option value="490">2/6</option> <option value="530">1/6</option> <option value="570">0</option> <option value="620">-2/6</option> <option value="660">-4/6</option> <option value="700">-15</option> <option value="740">-30</option> <option value="780">Promotion</option> <option value="840">1ère
Serie</option></select></td>
</tr>
<tr>
<td height="19" width="130" bgcolor="#ffffd7"> Licence</td>
<td height="19" width="167" bgcolor="#ffffd7"><!--webbot bot="Validation" B-Value-Required="TRUE" I-Maximum-Length="50" --><input maxLength="8" name="Licence"></td>
</tr>
<tr>
<td height="19" width="130" bgcolor="#ffffd7"> Sexe</td>
<td height="19" width="167" bgcolor="#ffffd7"><!--webbot bot="Validation" B-Value-Required="TRUE" I-Maximum-Length="50" -->Homme<input style="WIDTH: 20px; HEIGHT: 13px" type="radio" value="M" name="Sexe"> Dame <input style="WIDTH: 20px; HEIGHT: 13px" type="radio" value="F" name="Sexe"></td>
</tr>
<tr>
<td height="19" width="130" bgcolor="#ffffd7"> MotDePasse</td>
<td height="19" width="167" bgcolor="#ffffd7"><!--webbot bot="Validation" B-Value-Required="TRUE" I-Maximum-Length="50" --><input type="password" name="MotDePasse"></td>
</tr>
<tr>
<td height="1" width="297" colspan="2" bgcolor="#ffffd7">
<p align="center"><input type="submit" value="Envoyer"><input type="reset" value="Rétablir"></p>
</td>
</tr>
</table>
</center>
</form>
<%@ Language=VBScript %>
<%Option Explicit%>
<!--#include file="ConnexionDB.asp"-->
<%
dim objRS
set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "joueur",ObjCn,adOpenDynamic,adLockOptimistic
objRS.AddNew
objRS("nom") = Request.Form("Nom")
objRS("prenom") = Request.Form("Prenom")
objRS("Licence") = Request.Form("Licence")
objRS("classement") = Request.Form("Classement")
objRS("sexe") = Request.Form("Sexe")
objRS("motDePasse") = Request.Form("MotDePasse")
objRS.Update
objRS.Close
set objRS = nothing
ObjCn.Close
set ObjCn = nothing
%>
</body>
</html>