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
| Sub LectureAccess()
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=LecturePresses;DBQ=C:\Rapports\Labo\BDPresses.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" _
, Destination:=Range("B8"))
.CommandText = Array( _
"SELECT `Presse Jour`.Date, `Presse Jour`.Operateur, `Presse Jour`.`No Benne`, `Presse Jour`.`Q Pompe Lavage`, `Presse Jour`.`Mes Entre Rotary App`, `Presse Jour`.`Mes Entre Rotary Bal`, `Presse Jour`" _
, _
".`Sicc Poly 1`, `Presse Jour`.`Sicc Poly 2`, `Presse Jour`.`Validation Bal 1`, `Presse Jour`.`Echan Validation Bal 1`, `Presse Jour`.`Validation Bal 2`, `Presse Jour`.`Echan Validation Bal 2`," _
, _
"`Presse Jour`.`Dosage Poly Voulu Vis 1`, `Presse Jour`.`Dosage Poly Ri Vis 1`, `Presse Jour`.`Dosage Poly Rb Vis 1`, `Presse Jour`.`Dosage Poly Inst Vis 1`, `Presse Jour`.`Dosage Poly Calc Vis 1`," _
, _
"`Presse Jour`.`Q PTR 1`, `Presse Jour`.`Q PP1`, `Presse Jour`.`Ratio Poly 1`, `Presse Jour`.`Vit Vis 1`, `Presse Jour`.`Vit Floc 1`," _
, _
"`Presse Jour`.`Vit Rot 1`, `Presse Jour`.`Haut Head Box 1`, `Presse Jour`.`Back Plate 1`, `Presse Jour`.`Sicc 1 Vis 1`, `Presse Jour`.`Sicc 2 Vis 1`," _
, _
"`Presse Jour`.`Sicc 3 Vis 1`, `Presse Jour`.`Sicc Moy Vis 1`, `Presse Jour`.`Vol Boue Vis 1`, `Presse Jour`.`Vol Poly Vis 1`, `Presse Jour`.`Dosage Poly Voulu Vis 2`," _
, _
"`Presse Jour`.`Dosage Poly Ri Vis 2`, `Presse Jour`.`Dosage Poly Rb Vis 2`, `Presse Jour`.`Dosage Poly Inst Vis 2`, `Presse Jour`.`Dosage Poly Calc Vis 2`, `Presse Jour`.`Q PTR 2`, `Presse Jour`.`Q PP2`," _
, _
"`Presse Jour`.`Ratio Poly 2`, `Presse Jour`.`Vit Vis 2`, `Presse Jour`.`Vit Floc 2`, `Presse Jour`.`Vit Rot 2`, `Haut Head Box 2`," _
, _
"`Presse Jour`.`Back Plate 2`, `Presse Jour`.`Sicc 1 Vis 2`, `Presse Jour`.`Sicc 2 Vis 2`, `Presse Jour`.`Sicc 3 Vis 2`, `Presse Jour`.`Sicc Moy Vis 2`," _
, _
"`Presse Jour`.`Vol Boue Vis 2`, `Presse Jour`.`Vol Poly Vis 2`, `Presse Jour`.`Sicc1 Moy Benne`, `Presse Jour`.`Sicc 2 Moy Benne`, `Presse Jour`.`Sicc 3Moy Benne`,`Presse Jour`.`Sicc 2 Moy Benne`, `Presse Jour`.`Sicc 3Moy Benne`, `Presse Jour`.`Sicc 3Moy Benne`, `Presse Jour`.`Sicc 3Moy Benne`" _
, _
"" & Chr(13) & "" & Chr(10) & "FROM `C:\Rapports\Labo\BDPresses`.`Presse Jour` `Presse Jour`" & Chr(13) & "" & Chr(10) & "WHERE (`Presse Jou" _
, _
"r`.Date>={ts '2007-01-05 00:00:00'} And `Presse Jour`.Date<={ts '2007-12-25 00:00:00'})" _
)
.Name = "Lancer la requête à partir de LecturePresses_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub |
Partager