CraftLord
asked on
How to retrieve a list with current dsn names
Need to create a selection dialog where the users of my program can select the odbc dsn names.
So the program can dynamically access different databases.
So the program can dynamically access different databases.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Declare Function SQLDataSources Lib "ODBC32.DLL" (ByVal henv&, ByVal fDirection%, ByVal szDSN$, ByVal cbDSNMax%, pcbDSN%, ByVal szDescription$, ByVal cbDescriptionMax%, pcbDescription%) As Integer
Declare Function SQLAllocEnv% Lib "ODBC32.DLL" (env&)
Public Const SQL_SUCCESS As Long = 0
Public Const SQL_FETCH_NEXT As Long = 1
or another way is to read registry all dsn are stored in registry under
HKEY_Local_Machine --Software--odbc remember these will be system level dsn