Microsoft Knowledge Base Email Alertz

(217111) - When calling a method of a COM component that uses the getenv() function, the function returns a NULL value for the environment variable passed to it as parameter.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 217111 - Last Review: July 14, 2004 - Revision: 3.2

PRB: Calling getenv() in COM Objects Does Not Work Under Active Server Pages

This article was previously published under Q217111

SYMPTOMS

When calling a method of a COM component that uses the getenv() function, the function returns a NULL value for the environment variable passed to it as parameter.

CAUSE

The environment variable passed to getenv() is a user environment variable. Calling getenv() under Active Server Pages (ASP) can access only the system environment block.

RESOLUTION

Add the environment variable to the system environment block if you need to retrieve the variable from ASP.
  1. Right-click on the My Computer icon on the desktop.
  2. Click Properties.
  3. In the System Properties dialog box, click the Environment tab.
  4. Select an item from the System variables list.
  5. Enter the variable name in the Variable text box.
  6. Enter the value of the variable in the Value text box.
  7. Click Set.

STATUS

This behavior is by design.

APPLIES TO
  • Microsoft Active Server Pages 4.0, when used with:
    • Microsoft Internet Information Services 5.0
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Services 5.0
Keywords: 
kbprb kbsecurity KB217111
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate