Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 255887 - Last Review: June 19, 2001 - Revision: 1.0
PRB: Error When You Store a JScript Array in Application Scope in IIS 5.0
This article was previously published under Q255887
If you store a JScript array object in Active Server Pages (ASP) application scope using
Server.CreateObject but not using "Object tag", you receive the following error message:
Application object, ASP 0197 (0x80004005)
Disallowed object use
Cannot add object with apartment model behavior to the application intrinsic object.
JScript arrays are considered to be "Apartment" COM components. Only Component Object Model (COM) components that aggregate the Free Threaded Marshaler (FTM) can be assigned to Application scope within an Internet Information Server (IIS) 5.0 ASP page. Because an "Apartment" component cannot aggregate the FTM (it cannot allow a direct pointer to be passed to its clients, unlike a "Both with FTM" object), JScript arrays do not aggregate the FTM. Therefore, JScript arrays cannot be assigned to Application scope from an ASP page.
To reproduce this behavior, copy the following code to Microsoft Notepad, save it as Test.asp, and then test it.
<!-- TEST.ASP -->
<%@ Language=JScript%>
<%
var Arr = new Array(25);
Application("test") = Arr;
response.write ("Hello");
%>
You receive the above-mentioned error message.
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
255769Â
(http://kbalertz.com/Feedback.aspx?kbNumber=255769/EN-US/
)
ASP 0197 When Storing STA or Both-Model Objects in Application
APPLIES TO
- Microsoft Active Server Pages 4.0
| kbcodesnippet kberrmsg kbprb KB255887 |
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
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