Tuesday, May 03, 2005

MS Access System Information via OleDbCommand.GetOleDbSchemaTable

Equivalent of sys* tables of SQL Server in Access

"When working with SQL Server it is easy to get access to database metadata like tables, stored procedures etc, by using the sys* tables. I was doing some work with Access and wanted to do something similar, turns out that it is quite easy to do.

Basically the OleDbCommand.GetOleDbSchemaTable() method allows you to get as much metadata you want about the DB.

Pretty obscure but a God send when you really need it :)"


Sijin's post came JUST as I needed to do this very thing. How cool is that? I dig people who take the time to post cool info-snips like this...

I was going to dig through the hidden Access system tables (like MSysObjects, etc), but I think I'll try Sijin's approach first. Seems less horky.

Though the MSysQueries table looks kind of cool... It's Access Queries broken into parts, one row for each column returned in a query. Hummmm

No comments: