onsoir,
Déjà c'est in ('C:\my rep\mabase2.MDB')"
Ta table s'appel table1?
Édite: Effectivement erreur de syntaxes !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Sub test() With CreateObject("Adodb.Connection") .Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " & ThisWorkbook.Path & "\Database1.accdb;" Sql = "select * from table1 " Sql = Sql & " union all" Sql = Sql & " select * from table1 in '" & ThisWorkbook.Path & "\Database2.accdb'" ActiveCell.CopyFromRecordset .Execute(Sql) .Close End With End Sub
Partager