I don't believe so, but it seems like I'm in a catch 22, where I need to _winreg.OpenKey the key first before I can pass it to _winreg.DisableReflectionKey, but it doesn't exist, so I can't open it. <br><br>
I did find out that I can open the key using:<br>hKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\ODBC\ODBC.INI\<br>DRSQL2000_mu0100\\", 0, _winreg.KEY_READ | _winreg.KEY_WOW64_64KEY)<br><br>The 'trick' was adding _winreg.KEY_WOW64_64KEY, which apparently tells the system to look in the 64bit key area, and not under the Wow6432Node. That brings up problem #2, though... I can't seem to CREATE a key in the above path, and _winreg.CreateKey doesn't accept _winreg.KEY_WOW64_64KEY (in fact it doesn't accept any options other than key, sub_key). _winreg.CreateKey does work, it just puts the key in SOFTWARE\Wow6432Node\ODBC\ODBC.INI. So I'm in a quandry... I'd like to use one or the other, and not have to account for both. <br>
<br>much obliged<br><br><div class="gmail_quote">On Tue, Nov 17, 2009 at 2:18 PM, Nick Stinemates <span dir="ltr"><<a href="mailto:nick@stinemates.org">nick@stinemates.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
>From _winreg.c:<br>
<br>
"Disables registry reflection for 32-bit processes running on a 64-bit OperatingSystem. Will generally raise NotImplemented if executed on a 32-bit Operating System. If the key is not on the reflection list, the function succeeds but has noeffect. Disabling reflection for a key does not affect reflection of any subkeys."<br>
<br>
Are there any subkeys which you also need to disable? Parent keys?<br>
<div><div></div><div class="h5"><br>
<br>
On Tue, Nov 17, 2009 at 01:51:12PM -0500, Randall Walls wrote:<br>
> Greetings,<br>
><br>
> I'm writing a python script to automate creating ODBC connections on a<br>
> Windows2008 Server (64bit) platform. I created an ODBC manually (using the<br>
> GUI), for the purposes of fleshing out the 'check for existing' section of<br>
> the script.<br>
><br>
> Problem: though I can see the key in regedit<br>
> (HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\DRSQL2000_muXXXX), calling an<br>
> _winreg.OpenKey returns 'WindowsError: [Error 2] The system cannot find the<br>
> file specified'. Googling the error brought up the possibility that this key<br>
> is being impacted by registry redirection (<br>
> <a href="http://mail.python.org/pipermail/python-win32/2009-February/008862.html" target="_blank">http://mail.python.org/pipermail/python-win32/2009-February/008862.html</a>),<br>
> and thus the need to use _winreg.DisableReflectionKey to correct this.<br>
><br>
> I'm new to using _winreg (but not new to python), and though it sounds<br>
> simple, I can't figure out how to properly use _winreg.DisableReflectionKey<br>
> to make the _winreg.OpenKey work properly, and there is nearly 0<br>
> documentation on how to use _winreg.DisableReflectionKey (though I would be<br>
> happy to write something up if I could figure the damned thing out).<br>
><br>
> any help is appreciated. Has anyone else run into this before? I realize<br>
> that Server 2008 is new and that _winreg.DisableReflectionKey was just<br>
> added, but I'm still hoping SOMEBODY has run into this before.<br>
><br>
> Many thanks,<br>
><br>
> --<br>
> Randall Walls<br>
> Tyler Technologies, Inc<br>
<br>
</div></div>> --<br>
> <a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Randall<br>