[RESOLVED] Sudden "Error accessing the system registry"-VBForums
Results 1 to 9 of 9

Thread: [RESOLVED] Sudden "Error accessing the system registry"

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2007
    Posts
    36

    Resolved [RESOLVED] Sudden "Error accessing the system registry"

    Hello there,

    my VB 6 (SP6) model ran smoothly until this morning when I suddenly got the message "Error accessing the system registry". When I tried to run my model on another computer, I got the same error message. So the sudden appearance of this problem seems to be related to my model (rather than the VB 6 (SP6) installation on my computers that run on Vista).

    Would you have any idea how to proceed?

    Thank you for your help.

  2. #2
    Addicted Member
    Join Date
    Oct 2005
    Posts
    212

    Re: Sudden "Error accessing the system registry"

    I have that happen under Vista now and again. I just close the IDE then open it back up again. It usually works on the 2nd try. No idea why.

    --DB

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2007
    Posts
    36

    Re: Sudden "Error accessing the system registry"

    I did that this morning without any effect. In fact, I shut down the computer and re-tried it right afterwards, again without any success.

    A few hours later I restarted the computer again, and then it worked. My problem may have had to do with the time switch last night (in Canada) from summer to regular time. At least that's the only thing that changed to my knowledge.

  4. #4
    New Member
    Join Date
    Dec 2008
    Location
    Nairobi-Kenya
    Posts
    1

    Re: [RESOLVED] Sudden "Error accessing the system registry"

    Hi there,
    You may try the following,

    Select the Microsoft Visual Basic 6.0 shortcut from the Start menu and right-click on it. Select Properties, and the property sheet for the shortcut will be displayed. Next, click on the Compatibility tab. It is recommended that you make the following changes:
    1. Enable compatibility mode and select Windows XP (Service Pack 2) .....
    2. Check the "Disable visual themes" option .....
    3. Check the "Disable desktop composition" option.....
    4. Check the "Run this program as an administrator" option

    Click on OK to save the changes. When you run Visual Basic, a User Account Control (UAC) dialog will be displayed, asking you to confirm that you wish to execute the program. This is because it's now running with elevated privileges. You may also get a message that the color scheme has been changed to Windows Vista Basic. The Aero interface will be temporarily disabled until you close the IDE, which will resolve the performance issues with the form designer.

    Regards

  5. #5
    New Member
    Join Date
    Dec 2008
    Posts
    14

    Re: [RESOLVED] Sudden "Error accessing the system registry"

    hi
    Try performing these two tasks..

    1) Instead of installing vb6 again, try reinstalling Crystal Reports.
    2) Click Start, Programs, Microsoft Visual Basic 6 and Right Click The Visual Basic 6 Shortcut Icon. A Menu Will be shown.
    Now Click Run As...

    A Pop up box will appear asking you which User account do you want to use to run Visual Basic.
    Keep it to 'Current User' and remove the check from 'Protect My Computer and data from unauthorized program activity'

    This should help. Try this out...
    Regards
    Athar Anis

  6. #6
    New Member
    Join Date
    Nov 2009
    Posts
    1

    Re: [RESOLVED] Sudden "Error accessing the system registry"

    I know this is an old post - but I thought it deserved a revival...

    Okay new to the board, and I normally do not comment on programming sites - I just bear it all on my own lol ...BUT I've been battling with this error on and off for the past year. For the most part, I've figured out what to do and have it resolved...however, it just happened again - and I couldn't for the life of me remember what I did last time to sort it out.

    I just tried the below, and from what I do remember of what I did last time - this was simplier and faster, and it worked beautifully! There's at least hald a dozen 'fixes' out there for this but no one responds with what actually works or if someone else tried it...So danne, fantastic post - It works! YOU are a genious.
    Now I have no valid excuse for delaying the next version of this app...
    back to coding

    Thanks again.

    Quote Originally Posted by danne View Post
    Hi there,
    You may try the following,

    Select the Microsoft Visual Basic 6.0 shortcut from the Start menu and right-click on it. Select Properties, and the property sheet for the shortcut will be displayed. Next, click on the Compatibility tab. It is recommended that you make the following changes:
    1. Enable compatibility mode and select Windows XP (Service Pack 2) .....
    2. Check the "Disable visual themes" option .....
    3. Check the "Disable desktop composition" option.....
    4. Check the "Run this program as an administrator" option

    Click on OK to save the changes. When you run Visual Basic, a User Account Control (UAC) dialog will be displayed, asking you to confirm that you wish to execute the program. This is because it's now running with elevated privileges. You may also get a message that the color scheme has been changed to Windows Vista Basic. The Aero interface will be temporarily disabled until you close the IDE, which will resolve the performance issues with the form designer.

    Regards

  7. #7
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754

    Smile Re: [RESOLVED] Sudden "Error accessing the system registry"

    Another update:

    iTunes (and other apps yet to come) may also cause this problem in Win7.

    This is because it runs a service which creates registry keys under the SYSTEM account.

    When VB tries to enumerate the keys under HKCR\TypeLib it fails and gives the error because the user running VB6.EXE (even if it set to run as administrator) does not automatically have READ rights to the key. At that point you get the "Error accessing the system registry" dialog.

    To workaround/fix this:

    1. Download Procmon and PsExec from sysinternals.

    2. Run Procmon and add a "ProcessName" filter with VB6.EXE as the process name.

    3. Then Select Project->References. And the error dialog should pop up.

    4. Switch to procmon and scroll to the end of the events list - you're looking for the last "ACCESS_DENIED" message for opening a registry key under HKCR\TypeLib.

    5. Thats the first key you need to change permissions on - so you'll need to run regedit in the same account context that the keys were created in - the SYSTEM account. to do this install psexec on the windows PATH somewhere then run:

    psexec -i -d -s c:\windows\regedit.exe

    (obviously change the path if yours is different)

    this will run regedit through the SYSTEM account.

    *You can verify that even the administrator account does NOT have permission to edit these keys by running regedit through a Start->Run dialog as this elevates the priv' level to administrator.*

    6. Find the key you identified in step 4 - right click it and select Permissions.

    7. Find the current logged on user that you use to run VB6 with and add them with full control to the permissions list.

    8. Repeat steps 3-7 because there may be more keys that exhibit this behaviour, until the Project->References dialog appears in VB6 without error.

    You could also open the .vbp in notepad to see the references if you're stuck and dont have time to do the above.....
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  8. #8
    Registered User
    Join Date
    Feb 2013
    Posts
    1

    Re: [RESOLVED] Sudden "Error accessing the system registry"

    There is no need of installing other software like Crystal Reports or changing the registry, the only simple and permanent solution is to go to start menu then right click Microsoft Visual Basic 6 then select properties and click Compatibility from the dialog box that appears then check "Run this program as an administrator" under privilege level......... Hope that works. For more visit www.fredomondi.webs.com

  9. #9
    New Member
    Join Date
    Jan 2013
    Posts
    3

    Re: [RESOLVED] Sudden "Error accessing the system registry"

    Thanks. Been running into the same issue. Had been manually registering OCX's to clear the problem until today. Checked the "Run this program as an administrator" option to get past the error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.