This example creates a Snapshot listing all the tables in a database, then prints the data in the Snapshot on the active form.
Dim MyDB As Database, ListSet As Snapshot
Set MyDB = OpenDatabase("BIBLIO.MDB")
Set ListSet = MyDB.ListTables() ' Copy Table info to ListSet.
Do While Not ListSet.EOF
Print ListSet("Name"), ' Print data from each field.
Print ListSet("TableType"),
Print ListSet("RecordCount"),
Print Hex$(ListSet("Attributes"))
ListSet.MoveNext ' Move to next record.
Loop
The printout might look like the following table:
Name TableType RecordCount Attributes
Authors 1 46 0
Book Types 1 0 0
By State 5 #NULL# 0
Get State 5 #NULL# 0
MSysACEs 1 105 &H80000002
MSysColumns 1 108 &H80000002
MSysIndexes 1 15 &H80000002
MSysObjects 1 28 &H80000002
MSysQueries 1 80 &H80000002
Publisher Comments 1 8 0
Publishers 1 30 0
Title Author Publisher 5 #NULL# 0
Titles 1 50 0