Last active
March 10, 2019 12:18
-
-
Save ezhov-da/fa3e14c43352fd1349a3716aea763684 to your computer and use it in GitHub Desktop.
vba получение списка доступных подключений
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Sub qwqw() | |
Const HKEY_CURRENT_USER = &H80000001 | |
strComputer = "." | |
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") | |
strKeyPath = "Software\ODBC\ODBC.INI\ODBC Data Sources" | |
objRegistry.EnumValues HKEY_CURRENT_USER, strKeyPath, arrValueNames, arrValueTypes | |
For i = 0 To UBound(arrValueNames) | |
strValueName = arrValueNames(i) | |
objRegistry.GetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue | |
a = arrValueNames(i) & " -- " & strValue | |
Debug.Print a | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment