Error accessing the system registry

In Visual Basic 6, when I attempt to access Project > References, it throws an error:

Error accessing system registry

  • Logged in as the local computer administrator
  • running Windows XP Professional and
  • I can execute regedt32.exe and access all the registry keys just fine.

VB6 was installed as the local administrator.

Any idea why this happens?

I’m running crystal reports 8.5 and it supposed to already have fixed that issue but apparently I still have the issue with 8.5 installed. I have also made the attempt of reinstalling crystal reports with no luck on the issue.

14 Answers 14

Depending on the Windows OS you have (I have Windows 7 Enterprise), you might want to try giving administrator rights to the REGTLIB.EXE (located in C:Windws). Right click on the REGTLIB.EXE file. Select Properties from the pop-up menu. Then select the Compatiblity tab. On the Compatiblity tab, check/select the Run this program as Administrator checkbox. Click OK to save your changes. It might take take care of the problem for you. It worked for me. Good luck.

For me this worked:

  1. goto C:Program FilesMicrosoft Visual StudioVB98
  2. change the property of VB6.EXE by right click->Compatibility In privilege level section, check the option Run this program as Administrator

If you’re running Office 2010 (Beta) Word (apparently) writes a restricted registry key. VB throws the error when scanning the registry. The key I have is: HKCRTypeLib<00020905-0000-0000-C000-000000000046>8.5

For Regmon — Filter for Process Name -> "vb6.exe" and Result -> "ACCESS DENIED". Helps find it very quickly.

Fixed it with PSToosl (PSEXEC) to run registry editor (command line was psexec -i -d -s c:windows
egedit.exe from a Run-As-Administrator command line. HTH Jim. edit / ps — I’m on a Windows 7 (x64) box. Elevated permissions require the PSTools solution. XP can get away with a little less.

You could try Process Monitor to see which registry keys are accessed.

I got this on a machine that I was using for VB6 development. I had been building a lot of COM DLLs from VB6 (without binary compatibility) and the cruft that had built up in the registry eventually got too much.

Have a look at what size the registry is and what limit you have set. I doubled the registry size and then went looking for a good registry hoover.

Here is a solution from Microsoft. It references the Crystal Reports problem, but the solution just uses regedit32 to walk the HKEY_CLASSES_ROOTTypeLib and HKEY_CLASSES_ROOTCLSID registry branches for dimmed keys and correcting the security on those keys. There are also instructions to fix the security if regedit32 is unable to access the key. Article ID: 269383

In Windows 7 go to start menu then right click "Microsoft Visual Basic 6" then select properties and click Compatibility from the dialog box that appears then tick "Run this program as an administrator".

Have you tried this? Basically, it seems that it is a crystal reports issue. Hope that helps.

Perhaps worth a try going to the "User Account Control Settings". Regards,

When I installed VB6 on Win7-64 (using instructions easily found by a search engine), it worked fine. UAC was off — i.e. set to "never notify."

After a few weeks I turned UAC on — i.e. set it to its default. VB6 then couldn’t compile because of the "Error accessing the system registry" problem. Unfortunately, turning it off again didn’t help. Apparently the damage done by turning it on was irreversible. I can’t explain why this should be, but that’s my experience.

Giving REGTLIB.EXE administrative privileges while leaving UAC off sounded like a great idea, but that didn’t work for me either.

Finally, using Process Monitor and PsTools as described in other posts here worked. However, I had to give Full Control to large parts of my registry to Everyone. This didn’t apply just to isolated keys. It seems that the compiler needs to add keys to major nodes, so I had to open up these entire nodes.

Aside from the fact that working through these steps took hours, I’m now much more exposed than I was before I tried to increase security via UAC, However, I need VB6 and don’t see another solution short of a new computer.

Lesson: Don’t use UAC with VB6. Except if you’ve arrived here it’s too late for that.

Error accessing the system registry

Some operations must access your system’s registration database. This error has the following cause and solution:

  • The registration database for your system has been corrupted. Run the Setup program for thehost application again.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

when i want to add a component or Referrence to vb6 Project it give me this error msg : error accessing the system registry how i can fix that .
sry again

    2 Contributors

  • forum1 Reply 1,736 Views 23 Hours Discussion Span
  • commentLatest Post 7 Years Ago by AndreRet

Here is a few solutions.

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

When VB tries to enumerate the keys under HKCRTypeLib 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:

Download Procmon and PsExec from sysinternals.

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

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

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 HKCRTypeLib.

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

(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.

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

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

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.

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.

[an error occurred while processing the directive]
Карта сайта