Discussion Locked

VB RegCreateKeyEx failures

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Scenario:
Windows NT 4, VB 6.
User has access to Regedit and has no problems adding or modifying items to HKLM entries within registry.
VB code using Windows API (following ALL examples) returns a result of 5 (ERROR_CANT_WRITE?) for this user butworks for others! So far Nobody has been able to explain this or provide an answer (microsoft bug?). Can you?

3 replies

by for_serge

As I understand, you use KEY_ALL_ACCESS value as desired security access parameter.
Please try to use the following expression instead: (KEY_READ Or KEY_WRITE).
You need to use the same value as security access mask for the RegOpenKeyEx function.
Serge

by steve.calkin

Thanks Microsoft - once again the blindingly simple turns out to be a pain in the butt.
Why do they bother with a setting for ALL ACCESS if it doesn't really mean that!

This discussion is closed to new replies.