First add a reference to the Microsoft Access Object Library in your project's COM references.
The following job displays the name of the tables in the Output Window, use the same to fill your list:
Code:
Dim app As New Microsoft.Office.Interop.Access.Application
app.Visible = False 'Otherwise Access appears to the user
app.OpenCurrentDatabase("YourDatabase.mdb")
For Each table As dao.TableDef In app.CurrentDb.TableDefs
Debug.WriteLine(table.Name)
Next
app.Quit() 'Otherwise Access keeps running invisible in the background
In order for the Microsoft.Office.Interop namespace to be available, the Microsoft Office PIA (Primary Interop Assembly) must be installed on the development computer as well as on all the user stations. The PIA is installed when you specify that you want the .NET components when installing Office. It can also be installed independantly through a download on the Microsoft web site.
Jacques Bourgeois
JBFI
http://www3.sympatico.ca/jbfi/homeus.htm
Bookmarks