[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Microsoft VBScript runtime error '800a01a8'

Posted on 2003-11-24
6
Medium Priority
?
1,313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Technology Partners: 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 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

Technology Partners: 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!

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Six Sigma Control Plans

650 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