Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > NZ Computing > ASP Recordset Question

Reply
Thread Tools

ASP Recordset Question

 
 
Simon
Guest
Posts: n/a
 
      02-24-2004
I have created an ASP page which is designed to display links from a
database. The database table contains 3 columns:
- Category
- Title
- URL

The links are to be arranged under category headings, so I logically
thought that I could have a While Loop to create the headings, and while
the category remains the same display the link titles and urls
underneath the heading, which requires another (nested) While Loop.

However, ASP does not like this and as much as I try I cannot get the
recordset looping inside a recordset.

Please reply if you have any suggestions, as they are much appreciated.

Simon

 
Reply With Quote
 
 
 
 
Robert Bradshaw
Guest
Posts: n/a
 
      02-24-2004
Simon wrote:
> I have created an ASP page which is designed to display links from a
> database. The database table contains 3 columns:
> - Category
> - Title
> - URL
>
> The links are to be arranged under category headings, so I logically
> thought that I could have a While Loop to create the headings, and while
> the category remains the same display the link titles and urls
> underneath the heading, which requires another (nested) While Loop.
>
> However, ASP does not like this and as much as I try I cannot get the
> recordset looping inside a recordset.
>
> Please reply if you have any suggestions, as they are much appreciated.
>
> Simon
>



try opening two connections to the database with a recordset for each.
 
Reply With Quote
 
 
 
 
Alan Howard
Guest
Posts: n/a
 
      02-25-2004
Assumes your RecordSet is sorted on category. Untested, but you should get
the idea.

OldCategory = ""
Category = ""
Title = ""
Value= ""

Do While Not oTitles.EOF
Category = oTitles.Fields("Category").Value
Title = oTitles.Fields("Title").Value
Value = oTitles.Fields("URL").Value
If (Category <> OldCategory) Then
' New category. Output the category name and do any other
formatting.
Response.Write ...
' Assign the new category to the OldCategory variable.
OldCategory = Category
End If
' Output the title and URL values.
Response.Write ...
oTitles.MoveNext
Loop

' Close and kill ...

Regards,

Alan

"Simon" <simonatsimonbankdot@com> wrote in message
news:403bdb38$0$22510$(E-Mail Removed). au...
> I have created an ASP page which is designed to display links from a
> database. The database table contains 3 columns:
> - Category
> - Title
> - URL
>
> The links are to be arranged under category headings, so I logically
> thought that I could have a While Loop to create the headings, and while
> the category remains the same display the link titles and urls
> underneath the heading, which requires another (nested) While Loop.
>
> However, ASP does not like this and as much as I try I cannot get the
> recordset looping inside a recordset.
>
> Please reply if you have any suggestions, as they are much appreciated.
>
> Simon
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Datareader EOF Equivalent to ASP Recordset glenn22 ASP .Net 1 04-20-2007 05:23 PM
ADODB.recordset error (ASP/.NET) dradcnn@yahoo.com.sg ASP .Net 5 09-22-2005 05:15 PM
Asp to Aspx, Response.Write Recordset.fields(1).value question Gian Paolo Clarici ASP .Net 0 07-21-2004 12:14 PM
ASP Problem Updating Recordset =?Utf-8?B?a2JyYWQ=?= Microsoft Certification 3 04-10-2004 11:42 AM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM



Advertisments