PETOZAK  | Bonjour,
   Je dois alimenter une table à l'aide du code suivant:
  
  Code :
 - 'mettre des commentaires
 - Public Function construire()
 -     Dim n As Noeud, rst As Recordset, max As Long, arbre As Noeud, i As Long, j As Integer, col As Collection
 -    
 -     On Error GoTo handler
 -     'initialisation de l table des données
 -     Debug.Print Time & " - on efface l'arbre"
 -     CurrentDb.Execute "delete from " & ARBRE_TABLE
 -     Debug.Print Time & " - on charge toute les données l'arbre"
 -     'on récupère l'identifiant max pour définir la taille du tableau
 -     Set rst = CurrentDb.OpenRecordset("select max(IDENT) as idMax from FMB_FOLIO" )
 -     ReDim noeuds(rst!idMax)
 -     rst.Close
 -     'on charge tous les noeuds
 -     nb = 0
 -     Set rst = CurrentDb.OpenRecordset("VB_Noeuds" )
 -     Do While (Not rst.EOF)
 -         If (rst!mgr <= UBound(noeuds)) Then
 -             Set n = New Noeud
 -             nb = nb + 1
 -             n.setPrimaryProperties rst!ident, "" & rst!Name, "" & rst!ID_SECTION
 -             If (noeuds(rst!mgr) Is Nothing) Then
 -                 Set noeuds(rst!mgr) = New Collection
 -             End If
 -             noeuds(rst!mgr).Add Item:=n
 -             If (nb Mod 5000 = 0) Then Debug.Print nb
 -         Else
 -         ''Zak
 -             Debug.Print rst!mgr & " is out of range"
 -         ''Zak
 -         End If
 -         rst.MoveNext
 -     Loop
 -     rst.Close
 -     Set rst = Nothing
 -     'on construit l'arbre
 -     Debug.Print Time & " - on construit le nouvel arbre"
 -     CurrentDb.Execute "VB_Arbre_Ajout_Racine" 'on ajoute la racine
 -     Set arbre = New Noeud
 -     arbre.setPrimaryProperties 1, "racine", ""
 -     arbre.depth = 0
 -     chargerNoeud arbre
 -     Debug.Print Time & " - on sauve les données"
 -     nb = 0
 -     Set rst = CurrentDb.OpenRecordset(ARBRE_TABLE, dbOpenTable, dbAppendOnly)
 -     With rst
 -         For i = 1 To UBound(noeuds)
 -             Set col = noeuds(i)
 -             If (Not col Is Nothing) Then
 -                 For j = 1 To col.Count
 -                     Set n = col.Item(j)
 -                     .AddNew
 -                      !Name = n.nom
 -                      !ident = n.ident
 -                      ''Zak
 -                      If (Not n.pere Is Nothing) Then
 -                         !mgr = n.pere.ident
 -                      Else
 -                         Debug.Print "the father of " & n.ident & " is not defined"
 -                      End If
 -                      ''Zak
 -                      !ID_SECTION = n.section
 -                      !depth = n.depth
 -                     .Update
 -                     nb = nb + 1
 -                     If (nb Mod 500 = 0) Then Debug.Print nb
 -                 Next j
 -             End If
 -         Next i
 -     End With
 -     Debug.Print Time & " - l'arbre est finalisé"
 - handler:
 -     Debug.Print Time & " - L'arbre n'a pu être mis à jour " & Err.description
 -     'on sauve l'arbre
 - End Function
 
  |  
 
   Si je l'execute en local ca met 10 sec , en reseau plus de 20 min...
   Je ne comprend vraiment pas...Le volume traité est pas enorme en plus...
     Merci d'avance    |