Solved

Microsoft VBScript runtime error '800a01a8'

Posted on 2003-11-24
6
1,281 Views
Last Modified: 2010-04-17
I keep getting this error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
 
The code was generated by Macromedia Dreamweaver, and although I know a little bit about programming I can't figure out what's wrong with it. Here is the entire page.

Additional comment: the error references line 17:
 <% While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF)) %>


<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<!--#include file="Connections/guestbook.asp" -->



 </head>
 <body>
<table width="917" border="2" cellpadding="1" cellspacing="2">
  <tr>
    <td width="88">folderid</td>
    <td width="75">name</td>
    <td width="103">address</td>
    <td width="621">feedback</td>
  </tr>
  <% While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF)) %>
  <tr>
    <td><%=(rs5.Fields.Item("folderid").Value)%></td>
    <td><%=(rs5.Fields.Item("name").Value)%></td>
    <td><%=(rs5.Fields.Item("address").Value)%></td>
    <td><%=(rs5.Fields.Item("feedback").Value)%></td>
  </tr>
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs5.MoveNext()
      Wend
%>
</table>
<%
Dim rs5__MMColParam
rs5__MMColParam = "1"
If (Request.QueryString("sample") <> "") Then
  rs5__MMColParam = Request.QueryString("sample")
End If
%>
<%
Dim rs5
Dim rs5_numRows

Set rs5 = Server.CreateObject("ADODB.Recordset")
rs5.ActiveConnection = MM_guestbook_STRING
rs5.Source = "SELECT folderid, name, address, feedback FROM guest WHERE folderid = '" + Replace(rs5__MMColParam, "'", "''") + "' ORDER BY msgid ASC"
rs5.CursorType = 0
rs5.CursorLocation = 2
rs5.LockType = 1
rs5.Open()

rs5_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
rs5_numRows = rs5_numRows + Repeat1__numRows
%>
<%
rs5.Close()
Set rs5 = Nothing
%>

</body>
</html>

Appreciate your help.
elenapie
0
Comment
Question by:elenapie
  • 3
  • 2
6 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9812116
if the error is coming in this block:

</head>
 <body>
<table width="917" border="2" cellpadding="1" cellspacing="2">
  <tr>
    <td width="88">folderid</td>
    <td width="75">name</td>
    <td width="103">address</td>
    <td width="621">feedback</td>
  </tr>
  <% While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF)) %>


the problems is that the rs Object does NOT exist at that point in the execution of the code.

Take out the "AND (NOT rs5.EOF)" and try again.

This code looks VERY VERY suspect, by the way, as the variable Repeat1__numRows is ALSO not defined at Line 17.

AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9812119
did you manually alter this code, from what was created by DreamWeaver?

AW
0
 
LVL 7

Accepted Solution

by:
wsteegmans earned 500 total points
ID: 9812124
>> Additional comment: the error references line 17:
>> <% While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF)) %>

That's exact. The error is raised because of this part: 'NOT rs5.EOF'.
This rs5 variable is your RecordSet with Databaserecords. You declare it in this code:

Set rs5 = Server.CreateObject("ADODB.Recordset")  <- Declared
rs5.ActiveConnection = MM_guestbook_STRING
rs5.Source = "SELECT folderid, name, address, feedback FROM guest WHERE folderid = '" + Replace(rs5__MMColParam, "'", "''") + "' ORDER BY msgid ASC"
rs5.CursorType = 0
rs5.CursorLocation = 2
rs5.LockType = 1
rs5.Open()        <- Opened

Unfortunately, this code is executed after your while-loop. So, we do first the loop to print all records, and then we open our recordset. That's not the right method ofcourse.
>> While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF))

So, what we have to do. We must first declare our recordset (rs5), open it, and then print all the data to our HTML-Page. Change this to your code:
- Find this code-fragment:
<%
Dim rs5__MMColParam
rs5__MMColParam = "1"
If (Request.QueryString("sample") <> "") Then
  rs5__MMColParam = Request.QueryString("sample")
End If
%>
<%
Dim rs5
Dim rs5_numRows

Set rs5 = Server.CreateObject("ADODB.Recordset")
rs5.ActiveConnection = MM_guestbook_STRING
rs5.Source = "SELECT folderid, name, address, feedback FROM guest WHERE folderid = '" + Replace(rs5__MMColParam, "'", "''") + "' ORDER BY msgid ASC"
rs5.CursorType = 0
rs5.CursorLocation = 2
rs5.LockType = 1
rs5.Open()

rs5_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
rs5_numRows = rs5_numRows + Repeat1__numRows
%>
- Cut it (Ctrl-X) and Paste it (Ctrl-C) just under this line:
<!--#include file="Connections/guestbook.asp" -->

Try again!
What we've done. By moving the code, our recordset is first declared and opened. So, when we do the rs5.EOF-check, there is an existing rs5 with recordset from the database.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 7

Expert Comment

by:wsteegmans
ID: 9812127
>> Additional comment: the error references line 17:
>> <% While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF)) %>

That's exact. The error is raised because of this part: 'NOT rs5.EOF'.
This rs5 variable is your RecordSet with Databaserecords. You declare it in this code:

Set rs5 = Server.CreateObject("ADODB.Recordset")  <- Declared
rs5.ActiveConnection = MM_guestbook_STRING
rs5.Source = "SELECT folderid, name, address, feedback FROM guest WHERE folderid = '" + Replace(rs5__MMColParam, "'", "''") + "' ORDER BY msgid ASC"
rs5.CursorType = 0
rs5.CursorLocation = 2
rs5.LockType = 1
rs5.Open()        <- Opened

Unfortunately, this code is executed after your while-loop. So, we do first the loop to print all records, and then we open our recordset. That's not the right method ofcourse.
>> While ((Repeat1__numRows <> 0) AND (NOT rs5.EOF))

So, what we have to do. We must first declare our recordset (rs5), open it, and then print all the data to our HTML-Page. Change this to your code:
- Find this code-fragment:
<%
Dim rs5__MMColParam
rs5__MMColParam = "1"
If (Request.QueryString("sample") <> "") Then
  rs5__MMColParam = Request.QueryString("sample")
End If
%>
<%
Dim rs5
Dim rs5_numRows

Set rs5 = Server.CreateObject("ADODB.Recordset")
rs5.ActiveConnection = MM_guestbook_STRING
rs5.Source = "SELECT folderid, name, address, feedback FROM guest WHERE folderid = '" + Replace(rs5__MMColParam, "'", "''") + "' ORDER BY msgid ASC"
rs5.CursorType = 0
rs5.CursorLocation = 2
rs5.LockType = 1
rs5.Open()

rs5_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
rs5_numRows = rs5_numRows + Repeat1__numRows
%>
- Cut it (Ctrl-X) and Paste it (Ctrl-V) just under this line:
<!--#include file="Connections/guestbook.asp" -->

Try again!
What we've done. By moving the code, our recordset is first declared and opened. So, when we do the rs5.EOF-check, there is an existing rs5 with recordset from the database.
0
 
LVL 7

Expert Comment

by:wsteegmans
ID: 9812146
Sorry, posted it 2 times :-(
Just take a look at the last one...
0
 

Author Comment

by:elenapie
ID: 9812159
Didn't alter it at all...will try your suggestion
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now