In this short article, we will see how to list tables in a database schema. This will help users to check if a table exists, before they can query the database. This is especially useful when using Access databases, which do not allow users to check a table's existence via SQL statements. A database schema, in a layman's terms, is simply a repository that has information about the structure and content of the database. It also contains information about how the data is stored internally, as well as how it is stored physically on the storage device.
Database schema is primary to any database, as all requests to any data go through it.
Without a schema, it would be impossible to connect to any database. With that said, let's see how we can extract the list of tables from any database. The preceding picture shows an Access 97 database with three tables. Access also maintains a database schema, like any other database. Our goal is to list these tables in our ASP code.