Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Registry.Vcx
Message
From
10/11/1999 10:43:12
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00289509
Message ID:
00289596
Views:
37
>>>>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  && (( HKEY ) 0x80000000 )
>#DEFINE HKEY_CURRENT_USER           -2147483647  && (( HKEY ) 0x80000001 )
>#DEFINE HKEY_LOCAL_MACHINE          -2147483646  && (( HKEY ) 0x80000002 )
>#DEFINE HKEY_USERS                  -2147483645  && (( HKEY ) 0x80000003 )
>
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform