enumerate odbc data sources

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Using Framework 2.0 how can I get a list of odbc datasources on the local
machine?

Using the DbProviderFactory.CanCreateDataSourceEnumerator returns false.

This is the same with oledb providers which I also need to enumerate.

Any suggestions appreciated.
 
Stuart said:
Hi,
Using Framework 2.0 how can I get a list of odbc datasources on the local
machine?

Using the DbProviderFactory.CanCreateDataSourceEnumerator returns false.

This is the same with oledb providers which I also need to enumerate.

Any suggestions appreciated.

Registry:

HKLM\Software\ODBC\ODBC.INI

HTH,
Mythran
 
Stuart said:
Hi,
Using Framework 2.0 how can I get a list of odbc datasources on the local
machine?

Using the DbProviderFactory.CanCreateDataSourceEnumerator returns false.

This is the same with oledb providers which I also need to enumerate.

Any suggestions appreciated.

Well, almost (ignore my last post)..

try:
HKLM\Software\ODBC\ODBC.INI\ODBC Data Sources

:)

Mythran
 
Thanks a lot, this helps but ....

HKLM\......\ODBC.INI contains only \ODBC File DSN which points to C:\Program
Files\Common Files\ODBC\Data Sources, which contains nothing.

HKLM\.....\ODBCINST.INI does list the 'drivers', that's good, but where are
the user created odbc connections?

But the thing that bugs me most, is what is the DbDataSourceEnumerator for?
Yes, it enumerates instances of SQL server, but that is all it appears to do.

Any further information is greatly appreciated.
 
Stuart said:
Thanks a lot, this helps but ....

HKLM\......\ODBC.INI contains only \ODBC File DSN which points to
C:\Program
Files\Common Files\ODBC\Data Sources, which contains nothing.

Are you sure you are looking under HKEY_LOCAL_MACHINE?

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI should contain ODBC Data Sources
as well as a registry key for each system dsn on the machine and ODBC File
DSN. That's how it is on my machine...

Mythran
 
Back
Top