Results 1 to 2 of 2

Thread: How to display a random record from a DB

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242
    Hello all,

    I'm using FrontPage to develop a page that must display a random record form an Access DB, but the DB assistant isn't of much help...

    And, I don't know ASP :-(

    The only solution I found, is to use VBScript, which shouldn't be much different from VB (I guess).

    So if anyone can give me a small example on how to accomplish this, either in ASP or in VBScript, I'll be grateful.

    thanks!

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    Mexico City
    Posts
    242
    hello again

    while trying to do it myself, I was using this code:

    dim rs,sql,conn
    set rs=createobject("ADODB.Recordset")
    sql="SELECT * FROM Tips"
    conn="Provider=Microsoft.Jet.OLEDB.4.0;URL=http://server/tips.mdb"
    rs.open sql, conn
    msgbox rs.fields("tip").value

    but, nothing happens...

    If I insert msgboxes before each line, I see the code executes up to before rs.open

    what's wrong with the code?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width