473,382 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Object Required Error

At first I make a independend virtual directory wich I named app and I check
Directory Browsing in the Virtual Directory Properties. Then I create with
notepad global.asa and index.asp

global.asa
<OBJECT ID="objMyInfo" RUNAT="server" SCOPE="Application"
PROGID="MSWC.MYInfo"></OBJECT>
<SCRIPT Language="VBScript" RUNAT="server">
Sub Application_onStart()
objMyInfo.vDailyBanner="The Big News Today is..."
Dim vMyVar
vMyVar="Some text stored in the Application"
Application("storedtext")=vMyVar
End Sub
</SCRIPT>
index.htm
<HTML>
<HEAD><TITLE>Showing Application Variables</TITLE>/HEAD>
<BODY>
<H2>The Daily Banner Headlines</H2>
<%
objMyInfo.vDailyBanner="My Personal News is"
vDayBan=objMyInfo.vDailyBanner
Response.Write(vDayBan)&":"
vMVr=Application.Contents("storedtext")
Response.Write(vMVr)&"<BR>"
%>
</BODY>
</HTML>

I browse into the directory with Internet Explorer and I click index.asp.
Unfortunately I get the following error.

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/app/index.asp, line 6

I am an ASP Begginer. I wrote all these based into an ASP Begginers book.
I tried lots of times and can't get what is wrong.
I hope you can help me.
PS1: My platform information is: Windows XP Pro, IIS 5.1, IE6
Jul 19 '05 #1
3 5859
> I browse into the directory with Internet Explorer and I click index.asp.

First of all, don't do that. To run an ASP page, you *TYPE* the URL into
the browser, e.g. http://localhost/index.asp
objMyInfo.vDailyBanner="The Big News Today is..."
Can you explain why you think you need the MyInfo component to store text in
application scope?
PS1: My platform information is: Windows XP Pro, IIS 5.1, IE6


Also, from http://www.aspfaq.com/2413, which describes this error:

Active Server Pages, ASP 0134 (0x80004005)
The object has an invalid ProgID of 'MSWC.MyInfo'

"This can happen if you try to use the default global.asa that ships with
IIS 5.1 on Windows XP. XP doesn't ship with the MSWC.MyInfo object by
default, so the best solution is to rename the global.asa so it stops
causing problems. In the default web root, you really don't need a
global.asa anyway... and if you do, it should be a lot more barebones than
that one. "

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2
>First of all, don't do that. To run an ASP page, you *TYPE* the URL into
the browser, e.g. http://localhost/index.asp
Ok I type the URL directly but the result is the same
objMyInfo.vDailyBanner="The Big News Today is..."
Can you explain why you think you need the MyInfo component to store text
in application scope?
I have no idea. The book sais so. The idea is to show how to retrieve data
and variables from global.asa and it was supposed to work

"This can happen if you try to use the default global.asa that ships with
IIS 5.1 on Windows XP. XP doesn't ship with the MSWC.MyInfo object by
default, so the best solution is to rename the global.asa so it stops
causing problems. In the default web root, you really don't need a
global.asa anyway... and if you do, it should be a lot more barebones than
that one. "


There is not a global.asa inside the default web root. However do I have to
put my own global.asa to the default web root in order to work?
Jul 19 '05 #3
Scrap the stupid MyInfo code.

Global.asa:

<script language=vbscript runat=server>
sub application_onstart
application("foo") = "splunge"
end sub
</script>

Any ASP page within the same site/application folder:

<%=application("foo")%>

If this doesn't work, see

No offense to ASP authors who may be lurking, but ASP books are typically
the worst place to learn how to code in ASP (this includes the ASP books to
which I've contributed). They are almost exclusively comprised of
inefficient and/or non-working examples that demonstrate superfluous,
non-realistic and non-real-world scenarios.

Better to peruse some web sites, where you might not always escape the
above, but you'll find some good examples as well -- and they won't all be
obsolete. Here are some starting points:

http://www.aspfaq.com/2183

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave Hammond | last post by:
I've got what should be a simple assignment of either an element value or a default string to a variable, but when the element doesn't exist I get an "Object required" error rather than an...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
9
by: Remulac | last post by:
Hello, I'm trying to get the value out of a dropdown list box and assign it to a variable. When I click on the list box, I invoke this line of code. I get the error, "Object reference not set...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
0
by: Deepak C.G via .NET 247 | last post by:
I want to dispose the image object in my child form, unless I won't dispose this object i can't delete the image file in my folder. I get this error in MDIparent form "An unhandled exception...
8
by: ST | last post by:
Hello everyone, Can anyone help me with this error above when I debug my web app project in vstudio.net?? I can't figure it out! It was working fine for months, and now all of a sudden it's not!!...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
4
by: ink | last post by:
Hi All I am relatively new to doing this and i think that i am making some king of school boy error. The error i am getting is on the following line of code. XmlSerializer xs = new...
4
by: livmacca | last post by:
Hi, I am new to VB .Net programming and is trying to create a webpage. I encountered the following error and is totally clueless on how to make it work: ...
14
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.