Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP Navigation Error!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP Navigation Error!

 Post Reply Post Reply
Author
Bibsta View Drop Down
Newbie
Newbie
Avatar

Joined: 19 December 2004
Location: United Kingdom
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bibsta Quote  Post ReplyReply Direct Link To This Post Topic: ASP Navigation Error!
    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="Bibsta

 
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Bibsta View Drop Down
Newbie
Newbie
Avatar

Joined: 19 December 2004
Location: United Kingdom
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bibsta Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Bibsta View Drop Down
Newbie
Newbie
Avatar

Joined: 19 December 2004
Location: United Kingdom
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bibsta Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
aks427 View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 06 December 2003
Location: United States
Status: Offline
Points: 276
Post Options Post Options   Thanks (0) Thanks(0)   Quote aks427 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.