Thursday, January 21, 2010

Error Accessing the System Registry VB6 vb vba

When trying to access the reference dialog box in VB6 or vba the following error message may come.


Error Accessing the System Registry



The cause of this problem is a full/Clean Installation of Crystal Reports 8.0.0.371.
In crystal reports this problem will not come in 8.0.0.441 or higher.


To correct rgis problem follow the following steps

1. Use REGEDT32.exe to scan for keys that are dimmed in HKEY_CLASSES_ROOT\TypeLib and HKEY_CLASSES_ROOT\CLSID.

2. Use the RegMon utility from www.sysinternals.com. Run the filtering processes for Visual Basic, and then try accessing the References dialog box in Visual Basic. When the error occurs, switch to RegMon and make note of the last keys which were successfully read or written. (These should be from HKEY_CLASSES_ROOT\TypeLib or HKEY_CLASSES_ROOT\CLSID.)


To fix the permission problem follow the following steps

1. Load REGEDT32 and locate the keys that are dimmed from the preceding step 1, or the keys that you noted from step 2. (Note: If you used step 2, once you locate the key, look at the key or sub-key that immediately follows it in the Registry. If you did not have the appropriate permissions to access the key, it would not have even been logged through the RegMon utility and, as such, the entry you noted in step 2 will be the last successful read/write. Therefore, the one that followed it caused the error to occur.


2. On the Security menu, give the appropriate permissions to the key so that you, and Visual Basic, can access it:
Administrators - Full Control
Everyone - Read
System - Full
Users - Read
Modify the user list to suite your needs.

3. Sometimes REGEDT32 is not able to access the key, and it gives you an error stating that the security account information cannot be retrieved or found. You can fix this in the following ways:

a. On the Control Panel, double-click the Services icon.

b. Type the following command to schedule a new command prompt:AT 13:10 /Interactive cmd.exe

c. Change 13:10 to whatever time you want the cmd.exe (command prompt) to run: for example, one or two minutes from your current time.

d. Wait until this new command prompt starts. (Note: The window caption is similar to C:\Winnt\System32\MSTask.exe.) If the command prompt fails to start, please see Knowledge Base article 193852 (http://support.microsoft.com/kb/193852/EN-US/ ) "Task Scheduler May Fail to Run Job When Scheduled"

e. From the new command prompt, type the following, and then press enter: REGEDT32.EXE Because you start this process from the SYSTEM command prompt, REGEDT32 is also running under the SYSTEM security context.

f Repeat the preceding step 2, and then reset the permissions.

No comments:

Post a Comment