Don’t use VB Registry functions in WebClasses and ASP components

Don’t use VB Registry functions in WebClasses and ASP components

Here’s a scenario that might be familiar to you:

  • You create a WebClass or a regular COM component that will be invoked from within an ASP application
  • The application uses VB’s built-in registry functions, such as DeleteSetting, SaveSetting, GetSetting, or GetAllSettings
  • Everything works when you debug the application inside the IDE
  • However, the application raises a runtime error when you compile it and use in the production system
Because the compiled application doesn’t run in the interactive Windows desktop, you must go to the system Event Viewer to see the error message, which is Run-time error ‘5’: Invalid procedure call or argument.

This isn’t a bug, rather it’s a consequence of how those registry functions use the registry. Visual Basic 6.0 Webclasses and ASP components run under the Internet Information Server service. SaveSetting, GetSetting, DeleteSetting, and GetAllSettings use registry keys in the HKEY_CURRENT_USER registry subtree, but the IIS service can’t access the HKEY_CURRENT_USER registry subtree, and any attempt to do so will raise an error.

You can work around this problem by reading and writing to another area of the registry, such as HKEY_LOCAL_MACHINE or HKEY_USERS. You can use other functions in the Code Bank to do so.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several