The GetSchema method that lists tables (and other MDB frameworks) that you should use is a Connection method, not a reader. The getSchemaTable of the reader is used to read the table schema defined in the query
Here is an example of how to read all the tables of an MDB
// Microsoft Access provider factory
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
DataTable userTables = null;
using (DbConnection connection = factory.CreateConnection()) {
// c:\test\test.mdb
connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test\test.mdb";
// We only want user tables, not system tables
string[] restrictions = new string[4];
restrictions[3] = "Table";
connection.Open();
// Get list of user tables
userTables = connection.GetSchema("Tables", restrictions);
}
List<string> tableNames = new List<string>();
for (int i=0; i < userTables.Rows.Count; i++)
tableNames.Add(userTables.Rows[i][2].ToString());
Note:
Restrictions are an array that functions as a filter. If nothing is passed in it, all structures (tables, views, filters, forms, etc.) will be returned. Because OleDB is a generic provider (it serves both MDB and XLS, DBF, etc) the restrictions will depend on the base. I leave here the unofficial translation of the documentation:
The restrictionValues parameter can provide n depth values
that are specified in the collection of constraints for a collection
specific. To set values in a given constraint and not
define the values of the other constraints, you need to define the
previous constraints to null, and then put the value
appropriate for the constraint you want to specify a value for.
An example of this is the "Tables" collection. If the "Tables" collection has
three constraints (database, owner, and table name), and
you want to get only the tables associated with the owner
"Carl", you must pass the following values (at least): null,
"Carl." If a constraint value is not passed, the default values
are used for this restriction. This is the same mapping as pass
null, which is different from passing an empty string
for the value of the parameter. In this case, the empty string
("") is considered the value for the specified parameter.