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
| Private Sub ExportCatalogueDelcampe_UC_ES(Optional Path As String = "")
Dim RS As Recordset
Dim RSTheme As Recordset
Dim Themes As String
Dim Auteur As Variant
Dim i As Long
If Path = "" Then Path = CurDir & "\delcampe_UC_ES.csv"
If StrComp(Right(Path, 4), ".csv") <> 0 Then Path = Path & ".csv"
Open Path For Output As #1
Set RS = CurrentDb.OpenRecordset("Catalogue")
' Progression
If RS.RecordCount > 0 Then
DoCmd.Hourglass True
RS.MoveLast
SysCmd acSysCmdInitMeter, "Export du catalogue", RS.RecordCount
RS.MoveFirst
End If
i = 0
Do While Not RS.EOF
Set RSTheme = CurrentDb.OpenRecordset("SELECT Categorie FROM Categorie INNER JOIN ZCatLiv ON Categorie.IDCat = ZCatLiv.IDCat WHERE IDTyp = 1 AND ZCatLiv.IDLiv = " & RS!IDLiv)
Themes = ""
Do While Not RSTheme.EOF
Themes = Themes & RSTheme!Categorie & ";"
RSTheme.MoveNext
Loop
RSTheme.Close
If IsNull(RS!PreAuteur) Then
Auteur = RS!Auteur
Else
Auteur = "(" & RS!PreAuteur & ") " & RS!Auteur
End If
Print #1, """12200" & """;""" & RS!IDLiv & """;""" & Remplacer(RS!SusTitre_nl2 & """;""" & Remplacer(Auteur, """", "" & " ") & Remplacer(RS!Titre, """", "" & " ") _
& Remplacer(RS!Adresse, """", "") & Remplacer(RS!Collation_nl2, """", "") & Remplacer(RS!Reliure_nl2, """", "") & Remplacer(RS!Commentaire_nl2, """", "") _
& Remplacer(RS![RefBiblio_nl2], """", "") & """;" & CLng(RS![Prix]) & """;""" _
& "EUR" & """;""" & "1" & """;""" & "30" _
& """;""" & """""http://www.ultimocapitulo.net/images/illustrations/" & "" & RS!IDLiv & "" & ".JPG""" _
, vbCrLf, " ")
RS.MoveNext
i = i + 1
SysCmd acSysCmdUpdateMeter, i
Loop
RS.Close
Close #1
SysCmd acSysCmdRemoveMeter
DoCmd.Hourglass False
End Sub |
Partager