Bonjour,
j'ai besion d'être éclairé sur l'UPDATE. Dans le script qui suit, je récupère bien les données de ma base dans mon formulaire mais lorsque je veux enregistrer les modifs... RIEN NE SE PASSE !!!
Quelqu'un peux m'aider???
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/connPC.asp" -->
<html>
<%
Dim rsCoordonnees__MMColParam
rsCoordonnees__MMColParam = "8"
If (Request.QueryString("paysID" ) <> "" ) Then
rsCoordonnees__MMColParam = Request.QueryString("paysID" )
End If
Dim sql
if Request.QueryString("modif" ) = "Ok" then
'Conrole de saisie
sql = "UPDATE coordonnees SET nom=" &Request.QueryString("nom" )
sql = sql & ", adresse=" &Request.QueryString("adresse" )
sql = sql & ", code=" &Request.QueryString("code" )
sql = sql & ", ville=" &Request.QueryString("ville" )
sql = sql & ", telephone=" &Request.QueryString("telephone" )
sql = sql & ", mobile=" &Request.QueryString("mobile" )
sql = sql & ", fax=" &Request.QueryString("fax" )
sql = sql & ", mel=" &Request.QueryString("strmel" )
sql = sql & ", site=" &Request.QueryString("site" )
conn.Execute(sql)
end if
%>
<%
Dim rsPays
Set rsPays = Server.CreateObject("ADODB.Recordset" )
rsPays.ActiveConnection = MM_connPC_STRING
rsPays.Source = "SELECT DISTINCTROW pays.pays AS nompays, pays.paysID FROM pays RIGHT JOIN coordonnees ON pays.paysID=coordonnees.pays"
rsPays.Open()
%>
<%
Dim rsCoordonnees
Set rsCoordonnees = Server.CreateObject("ADODB.Recordset" )
rsCoordonnees.ActiveConnection = MM_connPC_STRING
rsCoordonnees.Source = "SELECT coordonnees.*, pays.pays as nompays FROM pays RIGHT JOIN coordonnees ON pays.paysID = coordonnees.pays WHERE (((coordonnees.pays)=" + Replace(rsCoordonnees__MMColParam, "'", "''" ) + " ));"
rsCoordonnees.Open()
%>
<head>
<title>Gestion des coordonnées</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../pc.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<table width="100%" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30" valign="middle"> </td>
</tr>
<td height="437" valign="middle"><div align="center">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">-
<%while not rsPays.eof%>
<a href="gestion.asp?paysID=<%=(rsPays.Fields.Item("paysID" ).Value)%>"><%=(rsPays.Fields.Item("nompays" ).Value)%></a> -
<%rsPays.MOVENEXT%>
<%wend%>
</div></td>
</tr>
</table>
<p> </p>
<h1>Gestion de coordonnées</h1>
<form name="form1" method="post" action="gestion.asp"> <%while not rsCoordonnees.eof%>
<table width="500" border="0" cellspacing="0">
<tr>
<td><b>Nom : </b></td>
<td width="343"><input name="nom" type="text" id="nom" value="<%=(rsCoordonnees.Fields.Item("nom" ).Value)%>" size="50"></td>
</tr>
<tr>
<td><b>Adresse :</b></td>
<td><textarea name="adresse" cols="38" rows="3" id="adresse"><%=(rsCoordonnees.Fields.Item("adresse" ).Value)%></textarea></td>
</tr>
<tr>
<td><b>Code :</b></td>
<td><input name="code" type="text" id="code" value="<%=(rsCoordonnees.Fields.Item("code" ).Value)%>" size="20"></td>
</tr>
<tr>
<td><b>Ville :</b></td>
<td><input name="ville" type="text" id="ville" value="<%=(rsCoordonnees.Fields.Item("ville" ).Value)%>" size="20"></td>
</tr>
<tr>
<td><b>Telephone : </b></td>
<td><input name="telephone" type="text" id="telephone" value="<%=(rsCoordonnees.Fields.Item("telephone" ).Value)%>" size="20"></td>
</tr>
<tr>
<td><p><b>Mobile :</b></p></td>
<td><input name="mobile" type="text" id="mobile" value="<%=(rsCoordonnees.Fields.Item("mobile" ).Value)%>" size="20"></td>
</tr>
<tr>
<td><b>Fax:</b></td>
<td><input name="fax" type="text" id="fax" value="<%=(rsCoordonnees.Fields.Item("fax" ).Value)%>" size="20"></td>
</tr>
<tr>
<td><b>Mel : </b></td>
<td><input name="srtmel" type="text" id="srtmel" value="<%=(rsCoordonnees.Fields.Item("mel" ).Value)%>" size="30">
</td>
</tr>
<tr>
<td><b>Site : </b></td>
<td><input name="site" type="text" id="site" value="<%=(rsCoordonnees.Fields.Item("site" ).Value)%>" size="30"></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
<%rsCoordonnees.MOVENEXT%>
<%wend%>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"> </div></td>
</tr>
</table>
<p>
<input name="modif" type="hidden" id="modif" value="Ok">
<input type="submit" name="Submit" value="Update"> </p>
</form>
</div></td>
</tr>
<tr>
<td height="30" valign="top"> </td>
</tr>
</table>
</td>
<td bgcolor="#FFE2CA"> </td>
</tr>
<tr>
<td valign="top" bgcolor="#F27424"> </td>
<td align="center" valign="top"> </td>
<td height="100%" valign="top" bgcolor="#FFE2CA"> </td>
</tr>
</table>
</body>
</html>
<%
rsPays.Close()
Set rsPays = Nothing
rsCoordonnees.Close()
Set rsCoordonnees = Nothing
%>