In SQL you can use
SELECT * FROM INFORMATION_SCHEMA.TABLES
etc to get information about the database structure. I need to know how to achieve the same thing for an Access database.
A DataTable that contains the requested schema information. The specified set of restrictions is invalid. The OleDbConnection is closed. The specified schema rowset is not supported by the OLE DB provider. The schema parameter contains a value of DbInfoLiterals and the restrictions parameter contains one or more restrictions.
The schema table is returned as a DataTable that has the same format as the OLE DB schema rowset specified by the schema parameter. Use the restrictions parameter to filter the rows to be returned in the DataTable (for example, by specifying restrictions for table name, type, owner, or schema).
One of the OleDbSchemaGuid values that specifies the schema table to return. An Object array of restriction values. These are applied in the order of the restriction columns. That is, the first restriction value applies to the first restriction column, the second restriction value applies to the second restriction column, and so on.
What databases support INFORMATION_SCHEMA views Database Information schema Alternative catalog SQL Server Yes System Catalog Views (sys schema) Azure SQL Database Yes System Catalog Views (sys schema) Oracle database No Data Dictionary Views / Catalog Views MySQL Yes No 14 more rows ...
The equivalent operation can be accomplished using
OleDbConnection.GetOleDbSchemaTable() method.
see http://support.microsoft.com/kb/309488 for more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With