469,573 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,573 developers. It's quick & easy.

Listing databases

I'm building a database export program where I want to allow the user to
choose a connection type (ODBC,OLEDB, or SQL), enter a connection
string, and then export the schema and a number of rows of data.

I need to fill a listbox with database names which the user id has read
access.

How would I go about getting the list of databases from a database
server such as SQL, Pervasive, Oracle, etc? Is there a generic method
that works regardless of database provider?

*** Sent via Developersdex http://www.developersdex.com ***
Dec 27 '06 #1
2 843
Terry Olsen <to******@hotmail.comwrote in news:u80xCqUKHHA.1280
@TK2MSFTNGP04.phx.gbl:
Is there a generic method
that works regardless of database provider?
I don't think so ... you'll have to query each database type manually.
Dec 27 '06 #2


"Terry Olsen" <to******@hotmail.comwrote in message
news:u8**************@TK2MSFTNGP04.phx.gbl...
I'm building a database export program where I want to allow the user to
choose a connection type (ODBC,OLEDB, or SQL), enter a connection
string, and then export the schema and a number of rows of data.

I need to fill a listbox with database names which the user id has read
access.

How would I go about getting the list of databases from a database
server such as SQL, Pervasive, Oracle, etc? Is there a generic method
that works regardless of database provider?

*** Sent via Developersdex http://www.developersdex.com ***
I wrote a database definition program awhile back that lists databases from
a server, then lists tables/column info and allows printing of the database
structure(s). What I did was created an interface (IDatabaseInfo for
example) and had methods called GetDatabases, GetTables, GetColumns, etc.
Then, for each DBMS it supported, all we had to do was create a class that
implemented the interface (SqlDatabaseInfo, AccessDatabaseInfo). Makes
things easier...and all you have to do is pass the class instance as the
interface around and call those methods :)

HTH,
Mythran
Dec 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by SU News Server | last post: by
3 posts views Thread by David Jacques | last post: by
3 posts views Thread by John Barr | last post: by
2 posts views Thread by Daniel Groh | last post: by
16 posts views Thread by Doug Hall | last post: by
1 post views Thread by Johnny Jörgensen | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.