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
| If Forms![Sauvegarde]![CocheDonnées] = True Then
FSO.CopyFile "c:\access\DVDData.mdb", "d:\access\", True
Barre.Max = 200
Fichiers.Visible = True
Fichiers.value = "Copie de C:\Access\DVDData.mdb vers D:\Access\DVDData.mdb"
Progression 'fonction pour progressBar
Set FSO = Nothing
End If
If Forms![Sauvegarde]![CocheAffiches] = True Then
Dim oRst As DAO.Recordset
Dim oDb As DAO.Database
Dim nbMax As Long
Set oDb = DBEngine.OpenDatabase("c:\access\DVDData.mdb")
Set oRst = oDb.OpenRecordset("Vidéo", dbOpenTable)
Dim source As String
Dim destination As String
Set oRst = oDb.OpenRecordset("SELECT RéfCollectionVidéo,Image FROM Vidéo ", dbOpenDynaset)
oRst.MoveLast
nbMax = oRst.RecordCount
oRst.MoveFirst
While Not oRst.EOF
destination = "d:\affiches\"
source = "c:\affiches\" & oRst.Fields("Image").value
FSO.CopyFile source, destination, True
Barre.Visible = True
t.Visible = True
Fichiers.Visible = True
Barre.Min = 0
Barre.Max = nbMax
Barre.value = Barre.value + 1
t.value = Format((Barre.value / Barre.Max), "00%")
Fichiers.value = "Copie de " & source & " vers " & destination & oRst.Fields("Image").value
DoEvents
oRst.MoveNext
Wend
oRst.Close
oDb.Close
Set oRst = Nothing
Set oDb = Nothing
End If |
Partager