Database, DatabaseName Properties Example

This example examines the Database property of a data control and prints the name of each Table in the Debug window.

Sub PrintTableNames ()
   Dim Td As TableDef
   ' Set database file.
   Data1.DatabaseName = "BIBLIO.MDB"
   Data1.Refresh   ' Open the Database.
   ' Read and print the name of each table in the database.
   For Each Td in Data1.Database.TableDefs
      Debug.Print Td.Name
   Next
End Sub