How to check the version of oracle provider for ole-db. OraOLEDB.Oracle provider

北战南征 提交于 2019-12-08 11:03:42

问题


How to check the version of oracle provider for ole-db. OraOLEDB.Oracle provider on windows 10 and windows 7 ?


回答1:


You can use for example tool RegDllView. Search for "OraOLEDB", result could be this:

A simpler approach would be this navigate to your ORACE_HOME\bin directory and locate file OraOLEDB??.dll. Check version with right-hand mouse click -> Properties -> Details.

However, you just get the version of the file, it does not necessarily mean that this DLL is also registered and ready for use.

Or use this VBScript:

Option Explicit
Const HKEY_CLASSES_ROOT = &H80000000

Dim Key, strComputer, objRegistry, strPath, arrKeys, fso
Dim strKeyPath, strValueName, strValue, uValue, ver

Set fso = CreateObject("Scripting.FileSystemObject")

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
objRegistry.enumKey HKEY_CLASSES_ROOT, "CLSID", arrKeys

For Each key In arrKeys
    strKeyPath = "CLSID\" & key
    strValueName = "OLEDB_SERVICES"
    If objRegistry.GetDWordValue (HKEY_CLASSES_ROOT, strKeyPath, strValueName, uValue) = 0 Then  
        'get the (Default) value which is the name of the provider
        objRegistry.GetStringValue HKEY_CLASSES_ROOT, strKeyPath, "", strValue
        If InStr(1, strValue, "OraOLEDB.Oracle", vbTextCompare) > 0 Then
            ' get expanded location
            objRegistry.GetStringValue HKEY_CLASSES_ROOT, strKeyPath & "\InprocServer32", "", strPath

            ver = fso.GetFileVersion(strPath)
            Wscript.Echo strValue & " @ " & strPath & " -> " & ver
        End If
    End If 
Next

OLE DB provider may exist in 32-bit or/and in 64-bit, so you may execute the script twice:

C:\Windows\System32\cscript.exe Print_OLE.vbs
C:\Windows\SysWOW64\cscript.exe Print_OLE.vbs


来源:https://stackoverflow.com/questions/54326983/how-to-check-the-version-of-oracle-provider-for-ole-db-oraoledb-oracle-provider

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!