>>>>I am trying to read ODBC information from the registry (specifically I'm trying to obtain the SourceDB) using the Registry.Vcx in VFP6.
>>>>However I'm not havy much luck - can anyone help?
>>>
>>>I found the VFP Registry class to be confusing and hard to use. I use Rick Strahl's free registry class to do this. He includes plenty of comments in the class. See
free utilities>>>
>>I've made a bit more progress since I posted the original question. I now can read in a value but only from the HKEY_CURRENT_USER. Do you know if there is anyway to change the root that it's pointing at?
>>I'd like to try and use this class before admitting defeat and using something else.
>
>The first parameter passed is the Key. In my constants definitions, I have:
>
>#DEFINE HKEY_CLASSES_ROOT -2147483648
>#DEFINE HKEY_CURRENT_USER -2147483647
>#DEFINE HKEY_LOCAL_MACHINE -2147483646
>#DEFINE HKEY_USERS -2147483645
>
>Then I just pass one of these constants to the API.
>
Thanks, by combining both of your answers I finally got it to work. Below is an example:
oReg.GetRegKey("SourceDB",@aODBC,"Software\ODBC\ODBC.INI\" + RequiredDSN ,HKEY_LOCAL_MACHINE)