<%
class Quotes
Public Function GetQuotes()
Dim sSQL, oSQL
Dim nRecordsAffected
Set oSQL = New DB_IO
sSQL = "Select * from Quotations "
Set GetQuotes = oSQL.RunSQLWithRS(sSQL)
Set oSQL = nothing
End Function
Public Function GetQuote(rNum)
Dim sSQL, oSQL
Dim nRecordsAffected
Set oSQL = New DB_IO
sSQL = "Select * from Quotations WHERE Id =" & rNum & " "
'response.write sSQL
'response.end
Set GetQuote = oSQL.RunSQLWithRS(sSQL)
Set oSQL = nothing
End Function
end class
%>
<%
Dim oQuote, oQuoteRS
Dim rNum, totQuotes, Quote, Author
Set oQuote = New Quotes
set oQuoteRS = oQuote.GetQuotes()
totQuotes = oQuoteRS.recordCount
Randomize
rNum = Int((totQuotes - 1 + 1) * Rnd + 1)
set oQuoteRS = oQuote.GetQuote(rNum)
Quote = oQuoteRS("Quotation")
Author = oQuoteRS("Author")
%>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||