Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
COM objects fail to print when called from ASP
Article ID: 184291 - View products that this article applies to.
This article was previously published under Q184291
A COM object that sends output to a printer fails when called from Active Server Pages (ASP) but functions correctly when called from an interactive application. This COM object could be either a commercial product such as a Microsoft Office application, or a custom third-party object. A common error message is "ClassName error '800a01e2' Printer error."
The standard APIs that most objects use to print depend on registry entries located in HKEY_CURRENT_USER. This registry hive is dynamic. Depending on which user context the process is running under, different information will be loaded into this hive. ASP pages run under IIS, which is running as the SYSTEM account. When you create an instance of a COM object in your ASP code, by default, it will also run as the SYSTEM account. By default, the SYSTEM account does not have any printers set up in the registry.
You can set up printers for the SYSTEM account to resolve this problem. To set up printers for the SYSTEM account, perform the following:
This method requires you to modify the registry using the Registry Editor.
WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.
To enable IIS to enumerate the network printers by using the SYSTEM account, follow these steps.
Note If the process is running under the Network Service account, explicit permissions to the newly created registry are required.
For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:
(c) Microsoft Corporation 1998, All Rights Reserved.
Contributions by John Lewis, Microsoft Corporation.