Getting Access table definitions
So far we have only created a single table but in a database with a number of tables we need to be able to view the table definitions.
Unfortunately we can’t use the SQL methods we have been doing so far. We need to dip into ADODB and ADOX to get this information.
MAKE SURE THAT THE DATABASE IS CLOSED BEFORE ATTEMPTING TO DO THIS
Create an ADODB connection and open the database using the JET provider and the path to your database.
We then create a ADOX catalog and set its ActiveConnection property to the connection
We have a tables collection where we can view basic table information. For an individual table we can view the table definitions
Name DefinedSize Type
---- ----------- ----
DOB 0 7
FirstName 255 130
ID 0 3
LastName 255 130
Next we need to dig into the type definitions so we can understand the listing and see how we can dump this information for all our tables