//检索ACCESS库里的所有属于用户的表
public DataView GetTable()
{
string sAccessConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + @"\DataSourece\Ticket.mdb;" + "Persist Security Info=True";//连接字符串
OleDbConnection conn = new OleDbConnection(sAccessConnection);//OLEDB连接
conn.Open();
DataTable tblSch = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
DataView view = tblSch.DefaultView;
view.RowFilter = "table_type='table' or table_type='view'";
return view;
}
转载于:https://www.cnblogs.com/Deckard/archive/2009/06/23/1508939.html