You receive an error message when you add an ActiveX Control to a Visual Basic 6.0 form (819029)



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic for Applications 6.0
  • Microsoft Visual Basic Learning Edition for Windows 6.0

SYMPTOMS

When you add a Microsoft ActiveX control to a Microsoft Visual Basic 6.0 form, you may receive the following error message and then Visual Basic Editor may close unexpectedly:
Visual Basic has encountered a problem and needs to close. We are sorry for the inconvenience.

CAUSE

When you add an ActiveX control to a Visual Basic 6.0 form, Visual Basic cannot create the ActiveX control cache (.oca) file for the control. This problem occurs if the user who adds the control does not have Create/Write permissions to the following folders on the computer:
  • The Windows folder, typically C:\WINNT or C:\Windows
  • The OCX folder, typically C:\WINNT\System32
  • The Visual Basic Installation folder, typically C:\Program Files\Microsoft Visual Studio\VB98

RESOLUTION

To resolve this problem, give the user Create/Write permissions to the folders that are listed in the "Cause" section of this article. Visual Basic Editor can then create the .oca file.

WORKAROUND

To work around this problem, an administrator can create the .oca file. To do this, an administrator can log on to the computer, insert the ActiveX control, and then log off the computer. Subsequently, a non-administrative user can successfully add the ActiveX control to the Visual Basic 6.0 form.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

MORE INFORMATION

Steps to reproduce the behavior

  1. Log on to the computer as an administrator.
  2. Revoke Create/Write permissions to the following folders for the non-administrative user:
    • C:\WINNT folder
    • C:\WINNT\System32
    • C:\Program Files\Microsoft Visual Studio\VB98
  3. Verify that there are no pre-existing .oca files in the folders that are listed in step 2. If there are pre-existing .oca files, rename the files or delete the files.
  4. Log off the computer as an administrator, and then log on to the computer as the non-administrative user from step 2.
  5. Start Visual Basic 6.0.
  6. On the Project menu, click Components.
  7. In the Components dialog box, click to select the Microsoft Common Dialog Control 6.0 control.
  8. Click OK to close the Components dialog box.

    You receive the error message that is mentioned in the "Symptoms" section of this article.

REFERENCES

For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

149429 INFO: What is an OCA file?

296108 PRB: Various issues in Visual Studio programs on Windows NT-based systems


Modification Type:MajorLast Reviewed:12/19/2003
Keywords:kberrmsg kbprb kbide KB819029 kbAudDeveloper