How to get tables/views/columns in ODBC (& OleDb)



Hi;

Note, this is all with ADO.NET using the ODBC and OleDb drivers

We've been using DataTable schemaTable = conn.GetSchema("views");
which was working ok and now we are finding some drivers where under
both ODBC and OleDb it is now returning hundreds of system views -
while table still seems to be ok (for now).

So my question is, how do I get the following from ODBC and OleDb in a
way that will work on all databases. And if there is no way to do
that, how do I do it for Sql Server 2000, Sql Server 2005, and Access.

1) Enumerate all user tables in a database.
2) Enumerate all tables (user & system) in a database.
3) Enumerate all user views in a database.
4) Enumerate all views (user & system) in a database.

5) Enumerate all columns in a table or view.
6) For a column, get it's data type.

7) Enumerate all user stored procedures in a database
8) Enumerate all stored procedures (user & system) in a database.
9) For a stored procedure, get all parameters and their data type.

10) For all objects - get the description of it in the metadata.

From reading the specs for ODBC and OleDb it seems that everything
above (with the possible exception of item 9) should be doable in a
standard way that works for every implementation.

Help please.

thanks - dave

david@at-at-at@windward.dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
.



Relevant Pages

  • Re: Cannot display ODBC login prompt - want to connect without DSN
    ... ODBC was superseded thirteen years ago by OleDb: ... In this particular case, my program will conect to an Oracle database, but ... There does not seem to be a .NET provider for MS Access, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO connection with VBS to locally stored MS-Access database
    ... Even using of the OLEDB Jet provider is better, I do not see any confusion ... You could use ODBC or OLEDB syntax but in this case ADO will using ... > I am trying to connect to a local Access database via ADO and VB Script. ...
    (microsoft.public.data.ado)
  • Re: Word 2000/2002 - Proper Mail Merge steps for ODBC?
    ... > I don't get the "Database has been placed in a state by ... Access runs the query and will prompt for any ... > my ODBC entry and click the "Configure" button, ... >>using OLEDB, it uses a more exclusive mode than it really ...
    (microsoft.public.word.mailmerge.fields)
  • String handling difference between ODBC and OLEDB
    ... We are working with Clarion 6 and connect to a Pervasive database. ... Each preference page has different variables that are defined with the ... ODBC driver, or an OLEDB driver. ... Now comes the thing I do not understand: When using the ODBC driver I ...
    (comp.lang.clarion)
  • RE: C# and ADO vs. ADO.NET
    ... The OleDb* objects, for instance OleDbConnection, OleDbCommand, etc. are designed to work with ANY database that you can provide an OLEDB connection string for basically, for instance Access, Sybase, ... If you want to be even more generic, you can use the Odbc* objects - these go through the ODBC and OLEDB layers, so expect them to be slowest, but can access any type of database that supports ODBC. ...
    (microsoft.public.dotnet.languages.csharp)