Bonjour,
Je suis parvenu à créer une zone de liste déroulante à partir d'une table Access, mais lorsque je veux récupérer ces valeurs par Request.Form dans une recherche, la chaine est incompète.
Exemple: "Dictionnaires de traduction" devient "Dictionnaires", "Art, sport" devient "Art," etc
Voici le code
Quelqu'un a-t-il une explication? Merci d'avance pour toute réponse, et bonne journée.
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 <% Call OpenConn(Conn) Sub OpenConn(Conn) strAccessDB = "sl_usuels.mdb" ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath(strAccessDB) & ";Jet OLEDB:Database Password=" & sPassword & ";" Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open ConnString End Sub Sub CloseConn(Conn) Conn.Close Set Conn=Nothing End Sub Function LoadOptions(QRY,Optcdu,Opt) SqlStr=QRY Set Rs = Conn.Execute(SqlStr) Do Until Rs.Eof Response.Write "<option value=" & Rs(Opt) & ">" & Rs(Opt) & "</option>" Rs.MoveNext Loop Rs.Close Set Rs=Nothing End Function %> <html> <head> <title>Formulaire dynamique</title> </head> <body leftmargin="20" marginheight="0" marginwidth="0" topmargin="0"> <div align="center"> <table width="32%" border="0" align="left" cellpadding="0" cellspacing="0"> <tr height="5"> <td height="5"></td> </tr> <tr> <td > <form method="POST" action="recherche.asp" name="recherche"> <div align="center"> <table border="0" width="98%" height="99"> <tr><td class="txtNormal">Usuels virtuels</td></tr> <tr> <td width="45%" valign="top" height="25" class="txtNormal"><select name="section" size="1" id="section"> <%=LoadOptions("SELECT T_matieres.matiere FROM T_matieres GROUP BY T_matieres.cdu, T_matieres.matiere;",1,0)%> </select></td> </tr> <tr> <td width="45%" valign="top" height="67"><br> <input type="submit" value="Envoyer" class="bouton"> </td> </tr> </table> </div> </form> <p> </td> </tr> </table> </div> <% Call CloseConn(Conn) %> </body> </html>
Partager