Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get list of Database names from SQL?

Status
Not open for further replies.

bakerm

Programmer
Apr 25, 2000
53
US
I am currently writing an app that needs to display the available databases that live on X server. How do I get these names?

Any help would be greatly appreciated.

Mark
 
Assuming the 'databases' are identifiable through a 'patern', you can use the DIR function in VB to get a list of the names. Even if there are a few different patterns, it is reasonably easy. Look up the DIR function in VB Help. The examples are reasonably clear (at least as far a programming documentation goes).

I do not know of any way to get such a list generically through SQL.



MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
In MS SQL server, you can do a:
[tt]
SELECT CATALOG_NAME from INFORMATION_SCHEMA.SCHEMATA
[/tt]

Which returns a list of databases the current user has permissions on.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top