Forum de discussion
Forum « Programmation ASP » (archives)
Re: filtrer/rechercher en ASP
Envoyé: 10 mai 2006, 9h00 par varin
<%
Connexion
SQLQuery = "SELECT DISTINCT trigramme FROM collaborateur "<p>
SQLQuery = SQLQuery & " order by trigramme "<p>
Set RS = OBJdbConnection.Execute (SQLQuery)
If Not estVide(RS) Then<p>
Do Until RS.Eof
response.write("<option value='" & Replace(RS("trigramme"),"'","&")<p>& "'>")<p>
response.write(RS("trigramme"))<p>
response.write("</option>")<p>
RS.MoveNext<p>
Loop<p>
End If<p>
Fermeture RS
%>
fichier liste1.asp
<%
Connexion
SQLQuery = "SELECT * FROM <p>
ads.rfi,collaborateur,service,site "<P>
SQLQuery = SQLQuery & " where<p> fk_id_pers=id_pers AND<p> fk_id_serv=id_serv AND<p>
fk_id_site=id_site"<p>
if trigramme <> "Trigrammes" and trigramme<>"" then<br>
SQLQuery = SQLQuery & "where trigramme like '" & <p> trigramme<p> & "'"
end if
SQLQuery = SQLQuery & " ORDER BY trigramme"
Set RS = OBJdbConnection.Execute(SQLQuery)
%>
Réponses
|