[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

error on this code

Posted on 2007-10-03
7
Medium Priority
?
372 Views
Last Modified: 2011-04-14
I have this code and it is given the below posted error

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/showdata.asp, line 17

that is line 17 on the below posted code.  Wscript.Echo "Server name:" & arrServiceList(0)

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>
<%
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("c:\sefl_data.txt", ForReading)
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , ",")
    Wscript.Echo "Server name:" & arrServiceList(0)
    For i = 1 to Ubound(arrServiceList)
        Wscript.Echo "Service: " & arrServiceList(i)
    Next
Loop
%>
</body>

</html>
0
Comment
Question by:eteran
7 Comments
 
LVL 16

Expert Comment

by:golfDoctor
ID: 20010584
You've not declared the Shell object in Wscript.  
0
 
LVL 16

Expert Comment

by:golfDoctor
ID: 20010600
set WScript= Server.CreateObjcet("WScript.Shell")

But why don't you just Response.Write?
0
 
LVL 1

Expert Comment

by:jangeador
ID: 20011281
Agree with golfDoctor. Response.Write is much better for ASP.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Accepted Solution

by:
deathtospam earned 2000 total points
ID: 20016468
Eteran --

It looks like you've copied some code from a .VBS script file to an ASP web page.  In ASP, the Response object -- which is automatically made available to you before you write any code -- is used to send information to the user's web browser.  For more information, check out W3Schools:

http://www.w3schools.com/asp/asp_ref_response.asp

But like the other experts have already said, you should use Response.Write if you want to send info to the browser, instead of WScript.Echo:

========================================================
<html>
      <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
            <title>New Page 1</title>
      </head>
      <body>
<%
      Const ForReading = 1
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      Set objTextFile = objFSO.OpenTextFile("c:\sefl_data.txt", ForReading)
      
      Do Until objTextFile.AtEndOfStream
            strNextLine = objTextFile.Readline
            arrServiceList = Split(strNextLine , ",")
            Response.Write "Server name:" & arrServiceList(0)

            For i = 1 to Ubound(arrServiceList)
                  Response.Write "Service: " & arrServiceList(i)
            Next
      Loop
%>
      </body>
</html>
========================================================


-= DeathToSpam =-
0
 

Author Comment

by:eteran
ID: 20071304
I am getting this error from using the above code

Response object error 'ASP 0251 : 80004005'

Response Buffer Limit Exceeded

/testing.asp, line 0

Execution of the ASP page caused the Response Buffer to exceed its configured limit.
0
 

Author Comment

by:eteran
ID: 20071457
Finally got it to work. Here is the final code. Greate job!
<html>
      <head>
            <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
            <title>New Page 1</title>
      </head>
      <body>
<%
      Const ForReading = 1
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      Set objTextFile = objFSO.OpenTextFile("c:\sefl_data.txt", ForReading)
     
      Do Until objTextFile.AtEndOfStream
            strNextLine = objTextFile.Readline
            arrServiceList = Split(strNextLine , ",")
            Response.Write "Server name:" & arrServiceList(0)

            For i = 1 to Ubound(arrServiceList)
                  Response.write "Service: " & arrServiceList(i)
            response.flush
            Next
      Loop
%>
      </body>
</html>

0
 

Author Comment

by:eteran
ID: 20071459
Had to add the response.flush
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question