View Access table definitions
We’ve looked quite a bit at how we can work with Access databases but how do we investigate the structure of the database. The first thing we need to know is the tables in our database
The first part of the function tests that the file exists – we’ve seen this before when opening databases. Previous functions have mainly relied on SQL and ADO.NET capability. In this case we are using ADO (the older brother of ADO.NET). We need to create a COM object for the connection and open it using the path to our database. This will fail if we already have the database open!! We will see how to cope with this later. We then need to create a ADO Active X catalog representing the database. From that we can list our tables. This list includes the system and user tables.
Next stages are to put in some error handling and decide how we will display the structure of an individual table.