CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Random Record

Print topic Send  topic

Author Message
Joe
Posted: 11/01/2004, 2:13 PM

I have a quote database. I want to display a random record everytime the page is refreshed.

I am using MS Access, CCS, .asp


Any help would be great. Thanks
ciberlin

Posts: 25
Posted: 11/03/2004, 8:06 AM

I'm trying to do the same but in MS SQL, IIS and ASP

any ideas
View profile  Send private message
NBDesign
Posted: 02/02/2005, 12:10 PM

Here you go, this works for me so I hope it will wor for you.

What I have done was created a table for an image and url, basically banner ads.

Create your table in access, SQL or what ever. Then create your Code Charge page and insert a Grid. (have not tried a record).

Since I need a linkable image, I creaged a label and set the properties to HTML.

Now set the Before Show Record to Custom Code and add this:

dim adNumber, maxNumber, adURL

maxNumber = CCDlookUp("count(*)", "disAds", "disADid", DBazdzyne)

Randomize

adNumber = Int(Rnd(10) * maxNumber) + 1

adURL = CCDlookUp("adUrl", "disAds", "disADid=" & adNumber, DBazdzyne)

rightSideBar.disAds.disAdImage.Value ="<a href=""" & adURL & """><img src='images/disad/" & adNumber & ".jpg' border='0' width='150' height='150' vspace='6' hspace='6'></a>"

The results for me are random records using 2 fields, the image and the URL fields.

This will be live on my site www.azdzyne.com in the next week or 2. I am making some major changes to that site.

Good luck, let me know if it works for you. ;-)

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.