获取Access中所有表和所有表字段属性的完美解决办法!
获取Access中所有表和所有表字段属性的完美解决办法!不需要引用ADOX
//schemaTable将取到所有用户表的信息,schemaTable取到指定表名的表的所有信息
OleDbConnection conn = new OleDbConnection(strConn);
conn.Open();
DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new Object[]{null, null, null, "table"});
DataTable schemaTable2 = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new Object[]{null, null, /*tablename*/, null});
conn.Close();
|