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
| <%@Language=vbscript%>
<html>
<head>
</head>
<body bgcolor="F0E68C" text="black">
<%'------------- déclaration de la base -------------------
DSN_BASE = "DBQ=" & Server.Mappath("Base Stats 3 Brasseurs.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};Driverld=25"
'------- création de la connection et du recordset -----------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DSN_BASE
Set RS = Server.CreateObject("ADODB.Recordset")
'------- définition et exécution de la requête ---------------
N=request.querystring("nom")
RequeteSQL="SELECT * FROM [F1-Fichier Clients] WHERE [F1-Fichier Clients].NOM like '" & N & "' ORDER BY NUMCARTE"
RS.Open RequeteSQL , Conn
if RS.EOF then %>
<b>Aucun client ne porte ce nom</b>
<% else %>
<table border="0" cellpadding="1" width="100%">
<tr>
<th>Numéro de carte</th>
<th>Nom </th>
<th>Prénom </th>
<th>Société 1</th>
<th>Société 2</th>
</tr>
<% Do While Not RS.EOF %>
<tr>
<td> <%=RS("NUMCARTE")%> </td>
<td> <%=RS("NOM")%> </td>
<td> <%=RS("PRENOM")%> </td>
<td> <%=RS("SOCIETE1")%> </td>
<td> <%=RS("SOCIETE2")%> </td>
</tr>
<% RS.MoveNext
Loop
end if%>
</table>
<%'-------fermeture de la connection et du recordset----------
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>
</body>
</html> |
Partager