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