tags:

views:

34

answers:

2

Hi there

Is there anyway to get information out of an Odbc data source when you know the DSN name? example, get a user id, etc

I need to open a connection to some dataSource and execute some command. The only thing I know is the data source name (DEfined in the ODBC Data Source Administrator) and the command text.

Now, if I need some more info about that data source, is there anyway to get that info programmatically? Maybe a class that represents an ODBC data source?

tks

A: 

I agree w/ Mr. Butterworth's comment, in that I'm not sure exactly what you're asking, but you can find some of the information in the registry in:

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ {DSN Name}

Chris Clark
A: 

There is a whole C API to support ODBC - see http://msdn.microsoft.com/en-us/library/ms714562%28VS.85%29.aspx. Other languages (and you don't say which one(s) you are using) provide wrappers around this. Given a data source name only, you may be able to access the data it refers to - it depends how its been set up.

anon