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
Solved

Microsoft VBScript runtime error '800a01a8'

Posted on 2003-11-24
6
1,290 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 101
AutoIncrement column based of FK 11 55
youtube blocking politics 4 56
Do Wend Macro not working 22 35
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

839 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