Print Page | Close Window

ASP Navigation Error!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14539
Printed Date: 30 March 2026 at 6:55am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP Navigation Error!
Posted By: Bibsta
Subject: ASP Navigation Error!
Date Posted: 03 April 2005 at 1:52pm

Having some trouble with a asp database navigation keep getting this error message:

Microsoft VBScript runtime error '800a01a8'

Object required: '1'

/navigation2.asp, line 65

Line 65 is in bold and underlined
Data base file is in a include:
<%
Set dbConn = Server.CreateObject("ADODB.Connection")
dbPath = Server.MapPath("nav.mdb")
dbConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & dbPath & ";"
%>
 
This is where the code starts
<%
'Dimension variables
Dim strCategory  'Gets Category Heading
Dim strCatRs  'Opens Category Recordset
Dim strSubRs  'Opens Submenus Recordset
Dim strCat_ID  'Holds Category ID
 
'Opens Category Recordset
set strCatRs = Server.CreateObject("ADODB.Recordset")
strCatRs.Open "Select * from tblNavCategory " , dbConn,1,3
 
'Category Id
strCat_ID = strCatRs.Fields("Cat_ID").Value
'Opens Submenus Recordset
set strSubRs = server.CreateObject("ADODB.Recordset")
Do Until strCatRs.EOF
strCatRs.MoveNext
Loop
'Gets The Category ID
If strCat_ID.EOF = True Then
Response.write "Cat_ID Field Is Empty Please Check Your Database And Try Again"
Else
End If
%>
<div align="left">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="171" height="17" id="AutoNumber1">
    <tr>
      <td width="172" height="22" background="/Forum/forum_images/table_bg_image.gif" style="border-left: 1px solid #999999; border-right: 1px solid #999999; border-top: 1px solid #999999; border-bottom-color: #999999; border-bottom-width: 1">
      <p align="center">
      <font style="font-size: 11px; font-weight: 700" face="Tahoma" color="#FFFFFF">
      Navigation</font></td>
    </tr>
    <tr>
      <td width="172" height="20" style="border-left: 1px solid #999999; border-right: 1px solid #999999; border-top-color: #999999; border-top-width: 1; border-bottom-color: #999999; border-bottom-width: 1" background="../../forum_images/white_tb.gif">
      <font style="font-size: 11px; font-weight: 700" face="Tahoma">&nbsp;
      <%
'Category Heading
'Category = strCatRs("NavCategory")
Response.write(strCatRs("NavCategory"))  'Outputs Category Heading
%>
  </font></td>
    </tr>
    <tr>
    <%
 strSubRs.Open "Select * from " & " tblNavSubCat" & " Where Cat_ID=" & " Cat_ID" & " Order By Sub_Title", dbConn,1,3
 Do while not strSubRs.EOF
 strSubRs.MoveNext
 Loop
%>
    <tr>
      <td width="172" height="15" valign="top" style="border-left: 1px solid #999999; border-right: 1px solid #999999; border-top-width: 1; border-bottom-width: 1">
      <font style="font-size: 11px" face="Tahoma">&nbsp;<a style="text-decoration: none" href="<% = strSubRs("Sub_URL")%>"><font color="#000000"><% = strSubRs("Sub_Title")%></font></a></font></td>
      </tr>
    <tr>
<%
'Loop Categorys
Do Until strCatRs.EOF
strCatRs.MoveNext
Loop
strCatRs.Close
Set strCatRs = nothing
'Loop Sub Menus
Do Until strSubRs.EOF
strSubRs.MoveNext
Loop
%>
      <td width="172" height="15" valign="top" style="border:1px solid #999999; ">
      <p align="center"><font face="Tahoma" style="font-size: 1pt">&nbsp;</font><font face="Tahoma" style="font-size: 7pt"><br>
      Powered by <a href=" http://www.bibsta.co.uk%22/ - Bibsta

 



Replies:
Posted By: michael
Date Posted: 03 April 2005 at 5:45pm
strCatID is an Integer it seems and does not hold a property of EOF. You need to boolean that on the recordset not a value.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Bibsta
Date Posted: 03 April 2005 at 6:20pm
Sorry im not sure what you mean im not the best with asp could you give me an example please?


Posted By: Phat
Date Posted: 03 April 2005 at 11:35pm
if strCat_ID = "" or strCat_ID = 0 then


strCat_ID is not an ADODB.recordset so you can not use .EOF on it.


Posted By: Bibsta
Date Posted: 04 April 2005 at 6:14pm
HI there thanks for all replays so far. I have changed the strCat_ID statement to = 0 then when i tested i got this error:
 
 ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/navigation2.asp, line 0

Whats does this mean and how can it be prevented?


Posted By: dj air
Date Posted: 04 April 2005 at 7:39pm
it shoulf be

if strCat_ID.EOF

if not strCat_ID = 0



then it will prevent the error


Posted By: aks427
Date Posted: 04 April 2005 at 9:38pm
The line should be

If strCatRs.EOF = True Then

Not

If strCat_ID.EOF = True Then

strCatRS is your recordset, not strCat_ID.  Usually you would call a recordset rsCat instead of strCatRS, because the str in front usually stands for String.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net