tags:

views:

22

answers:

1

I've gone through ODBC API searching for a function that can extract information of a data source. The closest I found is SQLDataSources that enumerates all data sources and gives you the DSN name/description.

But specifically I would to extract the TNS service name of an Oracle data source. This property appears in the registry under ServerName but I found no way to access it through an API.

+1  A: 

The SQLGetPrivateProfileString function, which is typically used by the ODBC Administrator for reading such information is probably the best one to use, as this would be OS independent and implemented by most ODBC Driver Managers on none windows platforms, like iODBC, UnixODBC etc.

hwilliams