Link to home
Start Free TrialLog in
Avatar of triphen
triphen

asked on

VB6 reading regsitery

Hello Experts,

I have an application that is supposed to read a registery key and populate a label with it's value. Here is the code:

    Dim oReg As Object
    Set oReg = CreateObject("WScript.Shell")
    lbl_LMIName.Caption = oReg.RegRead("HKLM\Software\LogMeIn\V5\WebSvc\" & "HostDescription")
    Set oReg = Nothing

Open in new window


It works perfect on WinXP but all other OS (7, 2008, 2012) it throws this error:

---------------------------
RemoteSupportUpdater
---------------------------
Run-time error '-2147024894 (80070002)':

Invalid root in registry key "HKLM\Software\LogMeIn\V5\WebSvc\HostDescription".
---------------------------
OK  
---------------------------

But the path does exist in the registry. Any ideas on what I am doing wrong?
Avatar of Scott C
Scott C
Flag of United States of America image

A quick search on that error turned up that there was some kind of incompatibility in the API.

http://answers.microsoft.com/en-us/office/forum/office_2010-customize/run-time-error-214702489-80070002/3bc02610-f710-4136-8640-464f9ed9cf36

I also found a reference to where there was a bitblip in the registry.

http://www.sevenforums.com/windows-updates-activation/310222-windows-7-update-error-80070002-story-fix.html

Make sure to go through it character by character.
Avatar of triphen
triphen

ASKER

Thanks for your quick response. I don't believe the first link applies to me and I went through letter by letter for the second link. See attached, the path is definitely there in the right place.

I saw another posting that said it may be due to permissions. How can I elevate my code to run as higher permissions? I already tried right click Run As Admin....
Avatar of triphen

ASKER

Bump
Avatar of triphen

ASKER

Anybody?
Avatar of triphen

ASKER

Bump.
ASKER CERTIFIED SOLUTION
Avatar of triphen
triphen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of triphen

ASKER

No answers, closing question and opening a new one.