Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read the registry from Cobol

Status
Not open for further replies.

5166narda

Programmer
Jul 9, 2002
35
US
Is there a way to read a registry value from a cobol program. I can do it in a VBscript with the regRead function but can not figure out how to do it in the program.

Any help?
 
I don't have access to my sample code here, but ...

You can use the same wshshell.regread function in AcuCobol, but it requires loading the ActiveX Windows Shell control.

Or, you can use the AcuCorp provided wrappers for the native registry Win32 API calls. See
I've not used AcuCobol since 5.2, so there may be better options now.

Glenn
 
thanks - we have been trying to use Req_Query_value but do not get any value returned. We are trying to read a value that is in Local_machine so it should already be opened. We can get a return code of zero back but no values.
 
Hi

Sounds like you're using the rights APIs, all right. I've tried them all the way up to 6.2 and they look ok.

Your other option, which is what we were doing before AcuCorp provided the wrappers, is write a C/C++ DLL that does the job for you...

Also, I think you might need admin rights for the LOCAL_MACHINE branch. Without them, you might be able to open a node (or at least the wrapper API says you just did so), but may not be able to access the data.


.DaviD.
 
I just had to add an open and close - it is working now.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top