Results 1 to 4 of 4

Thread: Windows 7 x64 ODBC 32-bit

  1. #1
    Vindicator is offline Getting Started on GPanswers.com
    Join Date
    Oct 2010
    Posts
    1

    Default Windows 7 x64 ODBC 32-bit

    I'm new here so hopefully this isn't a stupid question. Anyway... here is a question for the GP gurus out there. Today I was asked if I could push out System DSN settings to the 32-bit ODBC data sources on a Win7 64 bit machine. Two seperate versions!? This was new information to me, but there are two ODBC applets in Win7 x64... one here:

    C:\Windows\System32\odbcad32.exe (64 bit version)

    and one here:

    C:\Windows\SysWOW64\odbcad32.exe (you guessed it, 32 bit)

    (It seems you can't have them both open at the same time either)

    When I add System DSNs to a GPO under Computer Configuration\Preferences\Control Panel Settings\Data Sources it adds them to the 64 bit ODBC DSNs but I don't see anyway to add settings to the 32 bit version using Group Policy.

    Can you add System DSNs to the 32 bit ODBC settings with Group Policy?

    TIA,

    Vin

  2. #2
    deadlight is offline Getting Started on GPanswers.com
    Join Date
    Oct 2010
    Posts
    3

    Default Same

    Have you figured this out yet? I'm having the exact same issue.

  3. #3
    deadlight is offline Getting Started on GPanswers.com
    Join Date
    Oct 2010
    Posts
    3

    Default Workaround

    I was able to work around this issue by copying a script to the machine and using the task scheduler to run the script. The task is trigger on application or modification, so if a new odbc connection is added to the preference, i simply add that registry setting to the item level targeting. The script is as follows:

    On Error Resume Next
    Const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set objShell = CreateObject("WScript.Shell")
    Set objReg=GetObject("winmgmts:{impersonationLevel=imp ersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

    'Migrate Connections
    strKeyPath = "SOFTWARE\ODBC\ODBC.INI"
    strKeyPath64 = "HKLM\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\"
    MigrateODBC strKeyPath, strKeyPath64


    Function MigrateODBC (strKeyPath, strKeyPath64)
    objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
    For Each Subkey in arrSubKeys
    strSubKeyPath = strKeyPath & "\" & Subkey
    objReg.EnumValues HKEY_LOCAL_MACHINE, strSubKeyPath, arrEntryNames
    For Each Entry In arrEntryNames
    objReg.GetStringValue HKEY_LOCAL_MACHINE, strSubKeyPath, Entry, strValue
    strSubKeyPath64 = Replace (strSubKeyPath, strKeyPath, "")
    objShell.RegWrite strKeyPath64 & strSubKeyPath64 & "\" & Entry, strValue, "REG_SZ"
    Next
    Next
    End Function

  4. #4
    billf22152 Guest

    Default Typo

    Its 'impersonate' not 'imp ersonate'

    Quote Originally Posted by deadlight View Post
    I was able to work around this issue by copying a script to the machine and using the task scheduler to run the script. The task is trigger on application or modification, so if a new odbc connection is added to the preference, i simply add that registry setting to the item level targeting. The script is as follows:

    On Error Resume Next
    Const HKEY_LOCAL_MACHINE = &H80000002
    strComputer = "."
    Set objShell = CreateObject("WScript.Shell")
    Set objReg=GetObject("winmgmts:{impersonationLevel=imp ersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

    'Migrate Connections
    strKeyPath = "SOFTWARE\ODBC\ODBC.INI"
    strKeyPath64 = "HKLM\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\"
    MigrateODBC strKeyPath, strKeyPath64


    Function MigrateODBC (strKeyPath, strKeyPath64)
    objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
    For Each Subkey in arrSubKeys
    strSubKeyPath = strKeyPath & "\" & Subkey
    objReg.EnumValues HKEY_LOCAL_MACHINE, strSubKeyPath, arrEntryNames
    For Each Entry In arrEntryNames
    objReg.GetStringValue HKEY_LOCAL_MACHINE, strSubKeyPath, Entry, strValue
    strSubKeyPath64 = Replace (strSubKeyPath, strKeyPath, "")
    objShell.RegWrite strKeyPath64 & strSubKeyPath64 & "\" & Entry, strValue, "REG_SZ"
    Next
    Next
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Friendly URLs by vBSEO