呵呵,刚刚做这个,就借花献佛了
///
/// 获得当前Access数据库的表
///
///
///
public ArrayList DataScoreTableName(string Source)
{
ArrayList TableName = new ArrayList();
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Source;
OleDbConnection conn = new OleDbConnection(ConnectionString);
conn.Open();
DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,new object[] { null, null, null, "TABLE"});
foreach (DataRow dr in schemaTable.Rows)
{
TableName.Add(dr["TABLE_NAME"]);
}
conn.Close();
return TableName;
}