Board index » delphi » Enumerating ODBC DSN's

Enumerating ODBC DSN's

I'm trying to write a query utility, much like MSSQL Isql/w or Query
Analyzer, that allows a user to select an ODBC DSN from a listbox or
combobox to establish a connection to a SQL database.  Is there a way that I
can enumerate all the ODBC System DSN's on a machine to populate a listbox
either via Delphi functions or through the ODBC API interface from Delphi?

Any help would be greatly appreciated.
Thank you.
jw

 

Re:Enumerating ODBC DSN's


If ytou are using Delphi and BDE with Auto-ODBC on. . .

use a tSession and call
    tSession.GetAliasNames(List: TStrings);
this gives a list of all ODBC DSN and BDE Aliases

bas

Quote
Jim W. <722332.2...@compuserve.com> wrote in message

news:80ga51$gqg5@forums.borland.com...
Quote
> I'm trying to write a query utility, much like MSSQL Isql/w or Query
> Analyzer, that allows a user to select an ODBC DSN from a listbox or
> combobox to establish a connection to a SQL database.  Is there a way that I
> can enumerate all the ODBC System DSN's on a machine to populate a listbox
> either via Delphi functions or through the ODBC API interface from Delphi?

> Any help would be greatly appreciated.
> Thank you.
> jw

Re:Enumerating ODBC DSN's


Jim,

I do believe that since Win95, ODBC aliases are stored in the Registry
somewhere.  That's where I'd check first.

Jim Stanley
Jacobs Engineering

Other Threads