Print Page | Close Window

Show random data or image using ASP

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=26377
Printed Date: 28 March 2026 at 4:38pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Show random data or image using ASP
Posted By: Andy Rowland
Subject: Show random data or image using ASP
Date Posted: 07 October 2008 at 4:13pm
Using Dreamweaver, asp and Access. How can I show random images taken from an Access database using SELECT, FROM, WHERE, ORDER etc.
Thanks.


-------------
Who the hell is calling at this time?



Replies:
Posted By: mhanif
Date Posted: 12 October 2008 at 12:44am

Tell me more about it, what exactly do you want or show the url where u have seen something like that.

If its only image you want to show randomly then u don't need MS Access , you can read from folders also.
 
One more advice, if you are not addictive to dreamweaver then switch to MS Frontpage or its latest version Expression Web. Because when you are into ASP , I think Frontpage is best.
 
Do reply, i will see what i can do.


Posted By: Andy Rowland
Date Posted: 13 October 2008 at 9:33am

The site I have designed has lists of Bars and clubs with descriptions and locations etc. The information is stored on an Access database and is added on-line by admin staff and registered users. The Bars info is shown on the bars page etc.. I need to show random bar and club information on the main page each time the page loads.

As you can see from the link. The main page shows the latest bars/clubs info that has been added. I also want to show random bars and clubs.
http://www.justarrived-uk.com/ - http://www.justarrived-uk.com/
 
Thanks


-------------
Who the hell is calling at this time?


Posted By: mhanif
Date Posted: 13 October 2008 at 5:07pm

Ok i am checking it out, let me see if i can help you with this.



Posted By: mhanif
Date Posted: 16 October 2008 at 8:56am
Check your PM, i have sent url of ramdom image script. hope that helps. tc


Posted By: alabamatoy
Date Posted: 17 October 2008 at 1:30am
Microsoft has a freebie, see: http://support.microsoft.com/kb/247745 - http://support.microsoft.com/kb/247745


Posted By: Andy Rowland
Date Posted: 17 October 2008 at 8:25am
I think you are all missing the point. I don't want to show random images. I want to read and show random text data from an Access database.
It's information about bars and clubs. I want it to show information at random, each time the page is opened.


-------------
Who the hell is calling at this time?


Posted By: Scotty32
Date Posted: 17 October 2008 at 11:51am
If you search Google you will find many websites with tutorials answering your question. ('4 Guys From Rolla' springs to mind from when I did the same search a few years ago)

Access makes things a bit more difficult as there is no direct way of doing it.

One of the methods I have spotted on the web are getting the number of records you have and picking a number at random and load record whos ID is that number.

This would became a problem if you have deleted a few records as it may pick a number where the record with that ID has been deleted - which means it wont display anything.



With MSSQL you can just do "Order By NEWID()" and it will pick a record at random. For this and many other reasons, I would recommend moving to MSSQL.


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .



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