CodeItBetter Programming Another VB Programming Blog

How to List all Tables from an Access Database

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'Database - How to List all Tables from an Access Database

'Add a List Box to your form.
'Add reference to Microsoft DAO 3.6 Object Library

Option Explicit
 
Private Sub Form_Load()
    Dim DB As Database, qDef As QueryDef, TD As TableDef, DbName As String
    Set DB = OpenDatabase("C:\Temp\Test.mdb")
    For Each TD In DB.TableDefs
       If TD.Attributes = 0 Then List1.AddItem TD.Name
    Next TD
    DB.Close
End Sub
Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.