IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP Discussion :

Problème de recherche avec ASP & sqlserver


Sujet :

ASP

  1. #1
    Membre à l'essai
    Inscrit en
    Avril 2006
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 35
    Points : 24
    Points
    24
    Par défaut Problème de recherche avec ASP & sqlserver
    au début on visualise la liste des taches puis
    j'ai un formulaire qui contient la liste des tâches disponibles si on choisit une tâche et on clique sur rechercher elle s'affiche mais avec la liste déjà affiché exp: l1 (séléctionnée)
    l1
    l2
    l3 (liste affichée au début)






    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
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    <table width="497" height="318" border="0" align="center">
          <tr>
            <td width="491" height="64" valign="middle"><div align="center">
             <form name="form" method="post"> <table width="245" height="116" border="1" align="center">
                <tr>
                  <td height="28"><span class="Style7">Rechercher tâche </span></td>
                </tr>
                <tr>
                  <td valign="top"><table width="234" border="0">
                      <tr>
                        <td height="39" valign="top">Tâche</td>
                        <td align="left" valign="top">
                          <select name="cat">
                            <option selected>-Choisir une tâche- </option>
                            <%
    						  sql0="select * from taches"
    						  set rs = Server.CreateObject("ADODB.Recordset")
    						  rs.open sql0,conn
    						  while not rs.eof%>
                            <option ><%=rs("intitule")%></option>
                            <%rs.movenext
    						  wend
    						  rs.close
    						  set rs=nothing%>
                        </select></td>
                      </tr>
                      <tr>
                        <td colspan="2">
                          <div align="center">
                            <input type="submit" name="Submit" value="Rechercher" />
                        </div></td>
                      </tr>
                  </table></td>
                </tr>
              </table></form>
            </div></td>
          </tr>
          <tr>
            <td>
              <div align="left"></div>
              <table width="489" height="246" border="1">
                <tr>
                  <td width="97" height="23"><div align="left"><strong>Code</strong></div></td>
                  <td width="162"><div align="left"><strong>T&acirc;che</strong></div></td>
     
     
                  <td width="99"><div align="left"><strong>Editer</strong></div></td>
                  <td width="103"><div align="left"><strong>Supprimer</strong></div></td>
                </tr>
     
     
                <%
    sql = "select * from taches where intitule like '" & request.Form("cat") & "'"
    sql2 = "select * from taches"
     
    Set liste = Server.CreateObject("ADODB.Recordset")
    liste.open sql2,conn
    while not liste.eof%>
     
    			<tr>
                  <td height="24"><% =liste("id_tache")%></td>
                  <td><% =liste("intitule")%> </td>
     
    				<td><a href="javascript:;" onclick="window.open('modif_user.asp?id_tache=<% =liste("id_tache")%>','ModifierUtilisateur','scrollbars=yes,width=550,height=600,left=0,top=0');">
    				<div align="center"><img src="ic_delete.gif" width="12" height="13" /></div></td>
    				<td><a href="javascript:;" onclick="window.open('supp_user.asp?id_tache=<% =liste("id_tache")%>','SupprimerUtilisateur','scrollbars=yes,width=500,height=300,left=0,top=0');">
    				<div align="center"><img src="ic_delete.gif" width="12" height="13" /></div></td>
    			</tr>
     
     <% liste.MOVENEXT 
    wend 
    liste.close 
     
    'conn.close 
     
     
     
     
    if (request.Form("select") <> "-Choisir une tâche-") then 
    liste.open sql,conn
    while not liste.eof%>
     
    			<tr>
                  <td height="24"><% =liste("id_tache")%></td>
                  <td><% =liste("intitule")%> </td>
    				<td><a href="javascript:;" onclick="window.open('modif_user.asp?id_tache=<% =liste("id_tache")%>','ModifierUtilisateur','scrollbars=yes,width=550,height=600,left=0,top=0');">
    						<div align="center"><img src="ic_delete.gif" width="12" height="13" /></div></td>
    				<td><a href="javascript:;" onclick="window.open('supp_user.asp?id_tache=<% =liste("id_tache")%>','SupprimerUtilisateur','scrollbars=yes,width=500,height=300,left=0,top=0');">
    						<div align="center"><img src="ic_delete.gif" width="12" height="13" /></div></td>
     
    			</tr>
     
     <% liste.MOVENEXT 
    wend 
    'set liste=nothing
    conn.close 
    set conn=nothing
    end if
    %>
     
     
     
                <tr>
                  <td height="38" colspan="7"><a href="javascript:;" onclick="window.open('ajout_taches.asp','Ajout_Taches','scrollbars=yes,width=500,height=250,left=0,top=0');">Ajouter</a></td>
                </tr>
            </table></td>
          </tr>
        </table>

  2. #2
    Membre averti Avatar de Crazyblinkgirl
    Profil pro
    Inscrit en
    Janvier 2003
    Messages
    341
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2003
    Messages : 341
    Points : 344
    Points
    344
    Par défaut
    Bonjour,

    Quel est ton problème exactement? Ca n'est pas très clair

  3. #3
    Membre à l'essai
    Inscrit en
    Avril 2006
    Messages
    35
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 35
    Points : 24
    Points
    24
    Par défaut bonjour !
    mon problème:
    j'ai une liste ds laquelle il y a les tâches et un boutton rechercher lorsque je séléctionne une tâche elle s'affiche et si je ne séléctionne aucune tâche rien ne s'affiche je veux pouvoir afficher l'ensemble des tâches au début et si je séléctionne une tâche n'afficher que celle séléctionnée MERCI

Discussions similaires

  1. Problème de recherche avec critère venant d'une combobox
    Par chyanon dans le forum Macros et VBA Excel
    Réponses: 4
    Dernier message: 11/03/2010, 22h26
  2. problème de recherche avec filtre
    Par lenetfm dans le forum Bases de données
    Réponses: 13
    Dernier message: 08/08/2008, 11h19
  3. (debutant) Un petit problème du recherche avec xpath
    Par Zikas-r dans le forum XSL/XSLT/XPATH
    Réponses: 1
    Dernier message: 19/12/2007, 02h28
  4. problème de recherche avec les collections
    Par gibea00 dans le forum VB 6 et antérieur
    Réponses: 1
    Dernier message: 21/08/2007, 23h23
  5. problème de session avec asp
    Par salmer dans le forum ASP
    Réponses: 13
    Dernier message: 17/05/2006, 09h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo