Can my app select a datasource?

  • Thread starter Thread starter M K
  • Start date Start date
M

M K

I want the user to be able to select an ODBC data source from within
my application. Can my app bring up a list of DSNs? Or can I create a DSN
somehow? I don't know how my user's database might be set up, so I need it
to be dynamic.
 
Hi,

Thanks for your post. You can use the function SQLDataSources to retrieve
all data source names. Please refer to the following KB article:

HOWTO: Retrieving a List of All ODBC Data Sources
http://support.microsoft.com/?id=119064

If it's a .NET managed application, you should use P/Invoke to call this
unmanaged API:
Consuming Unmanaged DLL Functions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconconsumingunmanageddllfunctions.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top