Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - list of the ordered record
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

list of the ordered record

 Post Reply Post Reply
Author
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post Topic: list of the ordered record
    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

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2003 at 6:48am
Back to Top
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
brolinuk View Drop Down
Newbie
Newbie
Avatar

Joined: 24 October 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote brolinuk Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
stevem2003 View Drop Down
Newbie
Newbie
Avatar

Joined: 07 November 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevem2003 Quote  Post ReplyReply Direct Link To This Post 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;"

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 7:48am

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

GetRows() Will put the recordset into an array

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.