<%@ language="javascript" %> Recipes

smallsteril.gif (8026 bytes)

r3.jpg (6873 bytes)

r2.jpg (8414 bytes)

canvasspec.jpg (3912 bytes)

welcometoralph.gif (9167 bytes)
<% //OPEN THE CONNECTION Connatlas = Server.CreateObject("ADODB.Connection") Connatlas.Open("atlasawning","sa","") //COUNT HOW MANY QUOTES ARE IN THE DATABASE strSQL1="SELECT COUNT(*) FROM recipe" rsrecipe=Connatlas.Execute(strSQL1) strCount=rsrecipe(0) //SUBTRACT 1 THE ARRAY USES 0 AS ITS FIRST NUMBER strRandBanner=strCount-1 //ROLL THE DICE AND GENERATE A RANDOM NUMBER USING THE NUMBER FROM THE COUNT ABOVE rannum=Math.random()*strRandBanner; rannum=Math.round(rannum); strRandBanner=rannum //SELECT ALL BANNERS AGAIN WHICH MEET THE CRITERIA strSQL2="SELECT * FROM recipe" rsrecipe2=Connatlas.Execute(strSQL2) //CREATE A NEW ARRAY bannerselect = new Array i=0 //WRITE THE BANNER_ID'S TO THE ARRAY while (!rsrecipe2.EOF) { BannerNum=rsrecipe2('ID')*1 bannerselect[i]=BannerNum i=i+1 rsrecipe2.MoveNext() } TheNumber=bannerselect[strRandBanner] //PULL THIS BANNER OUT strSQL3="SELECT * FROM recipe WHERE ID="+TheNumber rsrecipe3=Connatlas.Execute(strSQL3) Response.Write ("") Response.Write ("") Response.Write ("") Response.Write ("
") Response.Write ("
"+rsrecipe3('recipename')) Response.Write ("
") Response.Write ("Ingredients:  "+rsrecipe3('ingredients')) Response.Write ("
") Response.Write ("Recipe:  "+rsrecipe3('recipe')) Response.Write ("
") %>

Click here for a
Printable Page

woodspoon.gif (3442 bytes)

smallralph.gif (26300 bytes)

  <% rsrecipe3.Close() rsrecipe.Close() rsrecipe2.Close() Connatlas.Close() %>

 

Global Lynx


Copyright ©2000

This Global Lynx site is designed to be viewed using Internet Explorer and Netscape versions 3.0 and up.   If you have an older browser,some features may not be functional.  This  web page was last updated on 06/02/00