Bonjour. Tout est dans le titre.
J'ai une fonction suppression qui ne supprime pas dans ma table.
Elle n'a qu'un champ, le champ Nom.
et le formulaire où je récupère la donnée à supprimer:
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 <%@ Language="VBScript"%> <% option explicit%> <% Dim data1 data1=replace(Request.Form("data1"),".",",") Dim str Dim cnBD Dim strSuppr Dim objRs Dim test test=0 str = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(".") &"\PR.mdb" strSuppr="DELETE ChefEquipe.Nom From ChefEquipe" set cnBD =Server.CreateObject("ADODB.Connection") Set objRs = Server.CreateObject("ADODB.Recordset") cnBD.Open str objRs.Open "SELECT Nom From ChefEquipe", cnBD Do While (test = 0 And Not objRs.EOF) If data1= objRs("Nom") Then test = 1 End If objRs.movenext Loop if test = 1 Then cnBD.Execute (strSuppr) End if objRs.Close set objRs=nothing cnBD.Close set cnBD=nothing Response.Redirect"menuGeneral.html" %>
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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Suppression de Chefs d'Equipe</TITLE> <META NAME="Generator" CONTENT="TextPad 4.4"> <META NAME="Author" CONTENT="?"> <META NAME="Keywords" CONTENT="?"> <META NAME="Description" CONTENT="?"> <LINK REL="stylesheet" HREF="Couleur.css" TYPE="text/css"> <link rel="stylesheet" type="text/css" href="menussjava.css" title="défaut"> <style type="text/css" media="print"> .noseeme {visiblity: visible} .seeme {display : none} </style> <style type="text/css" media="screen"> .noseeme {display: none} .seeme {visibility: visible} </style> <!-- #include file="menuGeneralSquelette.html" --> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?"> <%@ Language="VBScript"%> <div class="content"> <H3>Suppression de Chefs d'équipe</H3> <br><br></br></br> <FORM name="SupprChefEquipe" method="post" action="SupprimerChefEquipe.asp"> <TABLE ALIGN="left" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="30%"> <TR> <td><b>Nom du Chef d'Equipe :</b></td><td><div align=left><% Dim str Dim cnBD Dim RS Dim sql str = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(".") &"\PR.mdb" Set cnBD = Server.CreateObject("ADODB.Connection") cnBD.Open str set RS = server.CreateObject("ADODB.RecordSet") sql = "SELECT * FROM ChefEquipe" RS.open sql, cnBD %> <SELECT name="type"> <% do while not RS.eof %> <OPTION value="<% response.Write(trim(RS("Nom"))) %>"><% response.Write(RS("Nom")) %></OPTION> <% RS.movenext loop RS.close set RS = nothing cnBD.close set cnBD = nothing %> </SELECT></td> </TR> </table> <br></br> <br></br> <INPUT type="submit" value="Supprimer" name="btnSubmit"> </FORM> </div> </BODY> </HTML>
Quelqu'un voit pourquoi?
Et comment fait-on pour choisir plusieurs noms à supprimer dans le SELECT?
Partager