Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Classic ASP:  Display item until End Of File

Posted on 2007-04-10
9
Medium Priority
?
263 Views
Last Modified: 2008-02-01
Hello.  I am working with Classic ASP (Not .NET) with an MS Access database.

I just need to know the syntax of how to only show something while not at End Of File.

Example:  I only want to show the " | " symbol after each dynamic list link EXCEPT after the last one.

I thought it was something like:
<%IF NOT rsRecordset.Field ("Field name").EOF then%>
Show the symbol
<%END IF%>

Does this look right?

Thanks so much,
Shane
0
Comment
Question by:lshane
[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
  • 5
  • 3
9 Comments
 
LVL 22

Expert Comment

by:WMIF
ID: 18885531
its actually from the recordset itself.  

rsRecordset.eof
0
 

Author Comment

by:lshane
ID: 18885549
So, would it be as simple as:

<%IF NOT rsRecordset.EOF then%>
Show symbol
<%END IF%>

...OR, would I need to add quotes or parentheses or something else in the syntax?

0
 
LVL 22

Expert Comment

by:WMIF
ID: 18885550
eof will only be true once you have moved past the last record.

print - rec 1
rs.movenext
print - rec 2
rs.movenext
print - rec 3
eof = false
rs.movenext
eof = true
0
Industry Leaders: 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 22

Expert Comment

by:WMIF
ID: 18885553
that should work just as you have it.
0
 

Author Comment

by:lshane
ID: 18885604
OK - thank you for your help.  I need a little more, though.  I am using DW MX, becaue I'm not proficient enough not to use it.

Here is the link for the site:  <http://www.clutter2treasure.net/antiques_list.asp>
You will see the list of links in the center with the " | " after the last link.  I would like for that NOT to appear after the last link.

So, here is the segment of code for that loop:

------------------------------------------------------------------------------------------------------
While ((Repeat1__numRows <> 0) AND (NOT rsAntiqueList.EOF))
%>
                      <a href="antiques_results.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "subcatID=" & rsAntiqueList.Fields.Item("subcatID").Value %>"><%=(rsAntiqueList.Fields.Item("subcatName").Value)%></a>&nbsp;|&nbsp;
                      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsAntiqueList.MoveNext()

Wend
%>
------------------------------------------------------------------------------------------------------

What should I do?

Thanks so much,
Shane
0
 
LVL 9

Expert Comment

by:fuzzboxer
ID: 18885784
You may be able to do this without ASP.  You can use the pseudo-selectors :first-child and :before to denote that you want the pipe missing on the first link and printed on the rest.

a:first-child{
/*normal stylings*/
}
a:before{
content:"|"
}

I'll double check the code later, but that might get you started.

0
 
LVL 22

Accepted Solution

by:
WMIF earned 2000 total points
ID: 18885990
this should do it for you.  let me know how it comes out.

------------------------------------------------------------------------------------------------------
While ((Repeat1__numRows <> 0) AND (NOT rsAntiqueList.EOF))
%>
                      <a href="antiques_results.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "subcatID=" & rsAntiqueList.Fields.Item("subcatID").Value %>"><%=(rsAntiqueList.Fields.Item("subcatName").Value)%></a>
                      <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rsAntiqueList.MoveNext()
     if not rsAntiqueList.eof then
%>
&nbsp;|&nbsp;
<%
     end if
Wend
%>
------------------------------------------------------------------------------------------------------
0
 

Author Comment

by:lshane
ID: 18886372
Thank you, WMIF!  That was perfect!


Thanks so much,
Shane
0
 
LVL 22

Expert Comment

by:WMIF
ID: 18886408
glad to help.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

688 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