PRB: Visual Basic GetSetting and SaveSetting Do Not Work in IIS Components (250673)
The information in this article applies to:
- Microsoft Internet Information Server 4.0
- Microsoft Internet Information Server 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- the operating system: Microsoft Windows NT 4.0
- the operating system: Microsoft Windows 2000
This article was previously published under Q250673 IMPORTANT: This article contains information about modifying the registry. Before you
modify the registry, make sure to back it up and make sure that you understand how to restore
the registry if a problem occurs. For information about how to back up, restore, and edit the
registry, click the following article number to view the article in the Microsoft Knowledge Base:
256986 Description of the Microsoft Windows Registry
SYMPTOMS
If you create an ActiveX .dll file in Visual Basic that uses the GetSetting or SaveSetting functions, you may get an error message when you use these functions from an Active Server Page running under Internet Information Server (IIS) on Windows NT 4.0 or Windows 2000. The error that occurs will be "Invalid Procedure Call or Argument" (Error 5) from within the component, or "error '800a0005' Invalid procedure call or argument" from the ASP page that calls the component.
CAUSE
When GetSetting or SaveSetting are called, the information that they read or write is usually stored at HKEY_CURRENT_USER\Software\VB and VBA Program Settings. Components that run under an account that is a member of the "guests" group do not have an HKEY_CURRENT_USER hive loaded, so they attempt to write to HKEY_USERS\.DEFAULT\Software\VB and VBA Program Settings. Members of the guests group do not have permission to write to this registry key.
RESOLUTIONWARNING: If you use Registry Editor incorrectly, you may cause serious problems that may
require you to reinstall your operating system. Microsoft cannot guarantee that you can solve
problems that result from using Registry Editor incorrectly. Use Registry Editor at your own
risk.
To successfully write to the registry, you must ensure that the IUSR_MACHINENAME account has the proper permissions to the registry location in question.
On Windows NT version 4.0, you can use the standard Win32 registry APIs to write information to an area in the registry where the guests group has access (for example, HKEY_LOCAL_MACHINE, by default, allows everyone to read/write it). You cannot use the GetSetting/SaveSettings Visual Basic API to accomplish this.
To provide greater security, Windows 2000 limits the default access to registry to members of the guests group. Therefore, on Windows 2000, you must ensure that any area of the registry that you want to write to allows the IUSR_MACHINENAME the proper access.
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
145679 HOWTO: Use the Registry API to Save and Retrieve Setting
Modification Type: | Minor | Last Reviewed: | 7/16/2004 |
---|
Keywords: | kbprb KB250673 kbAudDeveloper |
---|
|