我使用以下VBA代码返回ODBCINST \ ODBC驱动程序中的键值。下面是列表,如果我查看regedit然后返回列表 我无法在任何地方找到返回的列表。
Dim strComputer As String, strKeyPath As String, strDrivers
Dim objRegistry As Object, arrValueNames, arrValueTypes
Dim iCounter As Integer
strComputer = Environ$("computername")
strDrivers = ""
strKeyPath = "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes
For iCounter = 0 To UBound(arrValueNames)
strDrivers = strDrivers + arrValueNames(iCounter) & vbCrLf
Next iCounter
MsgBox (strDrivers)
我不明白吗?