Request.querystring or Recordset.GetString?
am 28.02.2005 18:57:02 von andrewdreibI am still very new to ASP and am trying to create an ASP page that gets
records randomly from a database. Right not I can successfully get one
field of
information at a time and randomize it, but I need the whole string. I've
been searching the internet trying to find an answer to this question and I
found these two commands Request.querystring and Recordset.GetString, but I
don't think I know how to use them properly.
Here's the code I have now:
====================
âConnection String and SQL statement
Dim query, connStr
query = âselect * from numbersâ
connStr = âProvider=Microsoft.Jet.OLEDB.4.0;â & _
âData Source = F:\Inetpub\wwwroot\numbers.mdb;â
âOpening Database
Dim rs
Set rs = Server.CreateObject(âADODB.Recordsetâ)
rs.Open query, connStr, 3, , adCmdText
âGenerating random number from total number of records
Dim intRnd
Randomize Timer
intRnd = (Int(RND * rs.RecordCount))
âNow moving the cursor to random record number
rs.Move intRnd
âShowing the random statement
Response.Write ââ & rs(âIDâ) & ââ
âClosing the database
rs.Close
Set rs = Nothing
====================
Any help would be greatly appreciated, I'm running short on time.
~Andrew