Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 12:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default only pulling out 1 record

Hi there

I've got a sql statement and then a loop to request the data from the recordset; the only problem is that it only pulls out the same record x the amount of entries there are in the database. For example if I have adam in there as the first entry and then 25 other names after that, it pulls out adam 26 times and doesn't display anyother records. It's looping through the table the amount by the amount of records but only pulling out the top record.

Any help would be greatly appreciated.


Adam
 
Old April 7th, 2004, 12:57 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Can I see your code?

----------
---Snib---
----------

<><
 
Old April 8th, 2004, 04:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

Here goes. thanks!


strSQL = "SELECT Country, Beach, SName, STown, DateEntered, Review FROM WaveReviews WHERE Deleted = 0 AND Country = '" & request.Form("Country") & "' AND Beach = '" & request.Form("Beach") & "' ORDER BY DateEntered ASC"

    set rsReview = con.execute(strSQL)

    if rsReview.EOF then %>
    <%
    response.Write("<div align=""center"" class=""td"">")
    response.Write("Sorry no reviews exist for '" & request.Form("Beach") & "'.")
    response.Write("&nbsp;Be the first to submit a review")
    response.Write("<p>")
    response.Write("</div>")

    %>

    <%
    else

    strCountry = rsReview("Country")
    strBeach = rsReview("Beach")
    strName = rsReview("SName")
    strTown = rsReview("STown")
    strDate = rsReview("DateEntered")
    strReview = rsReview("Review")
%>
       <%do while not rsReview.EOF%>



      <tr>
        <td colspan="2" bgcolor="<%=colorx%>" class="td"><div align="left"><%=strReview%></div></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="<%=colorx%>">
          <div align="right" class="td"><em><%=strName%>,&nbsp;<%=strTown%>,&nb sp;<%=strDate%></em></div>
        </td>
      </tr>
            <%rsReview.movenext()%>

                <%loop%>
      <tr>
<%end if%>
 
Old April 8th, 2004, 02:27 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hcweb
Default

You need to place your strings inside the do while not/loop like so:

<%
  else
  Do While Not rsReview.EOF

  strCountry = rsReview("Country")
  strBeach = rsReview("Beach")
  strName = rsReview("SName")
  strTown = rsReview("STown")
  strDate = rsReview("DateEntered")
  strReview = rsReview("Review")
%>


Chris
 
Old April 12th, 2004, 07:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

of course! sorry being daft





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling Records from Friday istcomnet ASP.NET 1.0 and 1.1 Basics 6 July 18th, 2008 04:18 PM
pulling data from webpage zeeonline XSLT 3 July 27th, 2006 03:04 PM
Pulling records from the database debjanib ASP.NET 1.0 and 1.1 Professional 2 April 17th, 2006 09:03 AM
placeholder controls -- pulling data Fubar ASP.NET 1.0 and 1.1 Professional 6 September 8th, 2005 09:08 AM
Pulling Fonts from Word mruthven Pro VB.NET 2002/2003 0 November 13th, 2004 04:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.