Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
ASP General
random record with SELECT TOP does NOT work
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Jimmy, post: 4379480"] ok, your code always displays the 4th record. here is the entire code from my test page (thank you for your time, by the way) Dim oConn, oRS, randNum Randomize() randNum = (CInt(1000 * Rnd) + 1) * -1 Set oConn=Server.CreateObject("ADODB.Connection") oConn.Provider="Microsoft.Jet.OLEDB.4.0" oConn.Open Server.MapPath("temp.mdb") Set oRS=oConn.Execute("SELECT TOP 1 EMAIL_ADDRESS, Rnd(ID) FROM TABLE1 ORDER BY 2") Response.Write oRS("EMAIL_ADDRESS") oRS.close oConn.close Set oConn = nothing Set oRS = nothing [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
ASP General
random record with SELECT TOP does NOT work
Top