First, I'd like to say that I know absolutely NOTHING about ASP.
But, funny thing, I'm on another CF list where this came up - just
yesterday. Here's that post (minus email headers)... maybe you will find
something that helps?
Either way, best of luck. Kristi
-----Original Message-----
Here is the final code.
<%
dim tmp
tmp = ""
%>
<% do while not rsTemp.EOF %>
<% if tmp <> rsTemp("category") then %>
<% tmp = rsTemp("category")%>
<h4><%=tmp %></h4>
<% end if %>
<p><strong><%=rsTemp("Recipe_Title") %></strong></p>
<% rsTemp.MoveNext %>
<%loop%>
-----Original Message-----
Are you asking for the specific ASP code for looping? Or just for
grouping?
for grouping you would do something like this untested snippet (rs is
the
recordset name).
<%
dim tmp
tmp = "";
%>
<% do while not rs.EOF %>
<%if (tmp != rs("category") then%>
<% tmp = rs("category")%>
<h4><%tmp%></h4>
<% end if %>
<p><strong><%rs("Recipe_Title")</strong></p>
<%loop%>
-----Original Message-----
This is why I think ColdFusion is better, because I solved this problem
in 7 lines of code, but I know there are a lot of ASP users out there.
We have a simple site where users can see recipes grouped by category.
Here is the ColdFusion code, but I have to redo it in ASP for hosting
reasons. Any push in the right direction would help.
<!-- Simple Query -->
<cfquery datasource="#DSN#" name="rsGetRecipes">
SELECT Recipe.ID, Recipe.Recipe_Title, Recipe_Category.Category FROM
Recipe_Category INNER JOIN Recipe ON Recipe_Category.ID =
Recipe.Category_ID ORDER BY Recipe_Category.Category;
</cfquery>
<!-- Basic use of the group attribute of cfoutput -->
<cfoutput query="rsGetRecipes" group="Category">
<strong>#Category#</strong><br>
<cfoutput>
#Recipe_Title#<br>
</cfoutput>
<br>
</cfoutput>
=========================================================
Kansas City ColdFusion User Group's website & listserv is
hosted through the generous support of Clickdoug.com
To send email to the list, email [EMAIL PROTECTED]
To (un)subscribe, email [EMAIL PROTECTED] with your request.
For hosting solutions http://www.clickdoug.com
Featuring Win2003 Enterprise, RedHat Linux, CFMX 6.1.
======================================================