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:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...