enumerate odbc data sources

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.
 
M

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.

Registry:

HKLM\Software\ODBC\ODBC.INI

HTH,
Mythran
 
M

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
 
G

Guest

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.
 
M

Mythran

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top