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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list databases from VB?

Status
Not open for further replies.

magmog

Programmer
Nov 30, 2004
1
SE
Im writing a vb application that should present a connect-dialog to the user with every cataloged DB2 database to choose from. If the user chooses a DB that doesnt have a ODBC DSN, then the application creates one automaticly and connects to the DB using SQLOpen.

I call C-functions SQLDataSources in odbc32.dll and SQLConfigDataSource in odbccp32.dll to list all the existing ODBC DSN:s and create new ones (send a mail if you want the code for that)

Now for the problem:
I havent been able to find a API-function that does the same thing as "list database directory".
What im doing now is to parse the SQLDBDIR-file in VB to find all cataloged databases... that is kind of lame.
I step through the file byte by byte and when i find a ":"-character i step back 39-chars and reads 8 to get the alias. It works but its slow, ugly and makes me want to cry.
Anybody know any function in any dll i can call from VB to get the same info as "list database directory"?
 
Could you issue a query from VB to interrogate one of the SYSIBM catalog tables?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top