Geting tables from an MDB file

  • Thread starter Thread starter Paul Wardle
  • Start date Start date
P

Paul Wardle

I am using .Net 2.0 - how do I get the available tables froma MDB file? I
tried:
DataTable dt = connection.GetSchema("Tables");

But this returns system tables, as well as the tables I need. How do I
restrict this?

When I enumerate the available restrictions, I get 3: TABLE_CAT,
TABLE_SCHEMA, and TABLE_NAME. The docs imply that I should get 4 - including
TABLE_TYPE - but not for my test database!

Can I do restrict the returned schema info to the table type "TABLE"
automatically, or do I have to filter the schema info myself? What the best
way to do this?

Please help!!!!

Paul
 
Paul - I'm not sure if this is the best way, but it will work.

Proceed just like you are and in the next line - create a DataView and set
it's Rowfilter (or do DataTable.Select) so that only Table_Type of "TABLE"
is returned. This way you'll have a subset containing only the data you
want.
 
Back
Top