Bonjour a tous

Voila j'ai une page ajout.asp qui me permets d'ajouter des enreg a ma table (Saisie_Articles). Quand je clique sur le btn ENVOYER il me renvoi vers ma page ok.asp mais l'enreg n'est pas dans la table.

Comment faire ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<%
Set oConn = Server.CreateObject("ADODB.Connection") 'Création d'une instance
connstring="DRIVER={Microsoft Access Driver (*.mdb)}; " & "DBQ=......"
oConn.Open connstring 'Ouverture de la connection
oConn.Execute(SQLQuery) 'Exécution de la requête
oConn.close 'Fermeture de la connection
 
ENVOY = Left(UCase(Request("ENVOYER")),5) ' On récupère la valeur du bouton cliqué
If ENVOY = "ENVOY" Then ' Si le bouton ENVOYER a été cliqué, alors
If Request("Date") = "" OR Request("Libelle") = ""  OR Request("N°Fiche") = "" then 'On vérifie si les deux champs ont bien été remplis, sinon
msg = msg & "<B><I>Veuillez remplir tous les champs.</I></B><BR>" 'Message
End If
 
If msg = "" Then 'Si aucune erreur alors, création de la requête d'insertion dans la base
SQLQuery= "INSERT INTO Saisie_Articles (Date, Libelle, N°Fiche, Entrees, Sorties, Affectation)"
SQLQuery= SQLQuery & "VALUES( '" & Request("Date") & "','"& Request("Libelle")& "','" & Request("N°Fiche") & "','" & Request("Entrees") & "','" & Request("Sorties") & "','" & Request("Affectation") & "')"
 
Response.Redirect "ok.asp" 'Enfin, on va sur la fiche "OK" qui certifie le bon enregistrement des données
End If
 
Elseif Annuler = "ANNULER" Then ' Si Annuler a été cliqué alors...
Response.Redirect "ajout.asp" ' retour a la page Ajout.asp
End if
%>
<html>
<body>
<table>
<tr>
<td valign="top" bgcolor="#FFFFFF">
<CENTER>
<form method="POST" action="ok.asp">
<H2>Ajouter un enregistrement</H2>
<BR>
<table>
<tr>
<td>Date: </td>
<td>
<input type="text" name="Date" size="20" value="<%=Request("Date")%>">
</td>
</tr>
<tr>
<td>Libelle: </td>
<td>
<input type="text" name="Libelle" size="20" VALUE="<%=Request("Libelle")%>">
</td>
</tr>
<tr>
<td>N°Fiche: </td>
<td>
<INPUT TYPE="text" NAME="N°Fiche" SIZE="20" VALUE="<%=Request("N°Fiche")%>">
</td>
</tr>
<tr>
<td>Entrees: </td>
<td>
<INPUT TYPE="text" NAME="Entrees" SIZE="20" VALUE="<%=Request("Entrees")%>">
</td>
</tr>
<tr>
<td>Sorties: </td>
<td>
<INPUT TYPE="text" NAME="Sorties" SIZE="20" VALUE="<%=Request("Sorties")%>">
</td>
</tr>
<tr>
<td>Affectation: </td>
<td>
<INPUT TYPE="text" NAME="Afectation" SIZE="20" VALUE="<%=Request("Affectation")%>">
</td>
</tr>
<%=(msg)%> 'C'est ici que le message d'alerte est susceptible d'apparaitre s'il y a une erreur de saisie ou une saisie incomplète
</table>
<p>
<input type="submit" value="ENVOYER" name="Envoyer">
<input type="submit" value="ANNULER" name="Annuler">
</p>
</form>
</center>
</td>
</table>
</body>
</html>
merci d'avance