Sub TEST()
Dim cn As Object, tbl As Variant
Set cn = CreateObject("Adodb.connection")
With cn
.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Environ("UserProfile") & "\Documents\Database1.accdb;"
tbl = TableToutes(cn)
.Close
End With
For Each t In tbl
Debug.Print t
Next
End Sub
Public Property Get TableToutes(Connexion As Object)
Dim t() As String, i As Integer
TableToutes = False
With Connexion.OpenSchema(20)
While Not .EOF
ReDim Preserve t(i)
t(i) = !TABLE_NAME
i = i + 1
.MoveNext
Wend
.Close
TableToutes = t
End With
End Property