<% ' Path long de la base de données dbPath = Server.MapPath("../../base/bdc.mdb") ' Création de l'objet permettant la connexion Set Conn = Server.CreateObject("ADODB.Connection") ' Connexion Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & " DBQ=" & dbPath if Len(Trim(request.form("departement"))) <> 0 then dept = request.form("departement") nom = Session("login") 'Sélection du signataire du départememnt choisit sql = "SELECT SIGNATAIRES.SIGNATAIRE_NAME, DEPARTEMENT.DEPT_DES FROM SIGNATAIRES INNER JOIN DEPARTEMENT ON (SIGNATAIRES.ID_SIGNATAIRE = DEPARTEMENT.ID_SIGNATAIRE) WHERE (((DEPARTEMENT.DEPT_DES)='" & dept & "'));" Set selection_sign = Server.CreateObject("ADODB.RecordSet") Set selection_sign = Conn.Execute(sql) signataire = selection_sign(0) Session("signataire") = signataire selection_sign.close else nom = request.querystring("nom") Session("login") = request.querystring("nom") end if %> Création d'un bon de commande
BON DE COMMANDE - PURCHASE ORDER
  > Création d'un nouveau bon de commande

 

<% if Len(Trim(request.form("departement"))) <> 0 then %> <% else %> <% end if %>
<%=nom%>
Département
<%=dept%>
Signataire
<%=signataire%>
Département
Signataire
<% if Len(Trim(request.form("departement"))) <> 0 then 'on fait rien else 'Sélection des départemements sql = "SELECT DEPARTEMENT.DEPT_DES FROM DEPARTEMENT GROUP BY DEPARTEMENT.DEPT_DES;" Set selection_dept = Server.CreateObject("ADODB.RecordSet") Set selection_dept = Conn.Execute(sql) departement = selection_dept(0) %>
 Sélectionner le département relatif au bon de commande
<% end if %>
<% Conn.close %>