By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,182 Members | 1,166 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,182 IT Pros & Developers. It's quick & easy.

Listing databases

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a


"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.