可能重复:
Retrieve List of Tables in MS Access File
How can I get a list of tables in an Access (Jet) database?
Finding Tables in MS Access using C#
What is the OleDb equivalent for INFORMATION_SCHEMA
有没有办法获取an.mdb文件中所有表的列表及其关联的行数?
答案 0 :(得分:0)
使用此:
con.Open();
DataTable dt = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] {null, null, null, "TABLE"});
for (int i=0;i< dt.Rows.Count;i++)
{
MessageBox.Show( dt.Rows[i]["TABLE_NAME"].ToString());
}
con.Close();