Solved

Microsoft VBScript runtime error '800a01a8'

Posted on 2003-11-24
6
1,283 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

896 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

20 Experts available now in Live!

Get 1:1 Help Now