Print Page | Close Window

list of the ordered record

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=7065
Printed Date: 31 March 2026 at 4:31pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: list of the ordered record
Posted By: brolinuk
Subject: list of the ordered record
Date Posted: 06 November 2003 at 9:21pm

I tried to list the top 5 record from the database in the order of hot 

SELECT TOP 5 * FROM table ORDER BY hot DESC

I am not sure this would be correct. I also want to list these 5 record in a table. How can I make it and especially I want to gave each of the a particular name. Dose it have something like RS.content? Thanks




Replies:
Posted By: MorningZ
Date Posted: 07 November 2003 at 5:13am

for your query.. did you at least just simply try it?

as for:
"How can I make it and especially I want to gave each of the a particular name"

what's that mean?  what are you trying to do?

 



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: brolinuk
Date Posted: 07 November 2003 at 8:37pm
I just want to list the top five record in a table. As I don't how to do it, I cant test whether the SQL is correct


Posted By: Mart
Date Posted: 08 November 2003 at 6:48am
http://webwiz.net/asp/tutorials/connecting_to_a_database_pt2.asp - http://webwiz.net/asp/tutorials/connecting_to_a_databas e_pt2.asp


Posted By: brolinuk
Date Posted: 08 November 2003 at 8:56pm
Thanks Mart. I know how to use for loop to list those records now, but is there a way to transfer them to an array, like rs[1] ? Thanks


Posted By: brolinuk
Date Posted: 08 November 2003 at 9:19pm

I tried the SQL I wrote above and it actually dosen't work. The error message is

Microsoft VBScript runtime (0x800A01A8)
Object required: '[string: "SELECT TOP 5 * FROM "]'

Anybody can help me out? thanks



Posted By: stevem2003
Date Posted: 10 November 2003 at 7:05am

I've used the following SQL statement many times:-

strSQL = "SELECT Top 5 field1, field2, field3, field4, field5 FROM table ORDER BY field1 DESC;"



-------------
There's no point running if you're on the wrong road!


Posted By: Mart
Date Posted: 10 November 2003 at 7:48am

http://www.w3schools.com/ado/showasp.asp?filename=demo_ado_getrows - http://www.w3schools.com/ado/showasp.asp?filename=demo_ado_g etrows

GetRows() Will put the recordset into an array




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net