PDA

Click to See Complete Forum and Search --> : How to display a random record from a DB


gxpark
Nov 9th, 2000, 03:02 PM
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!

gxpark
Nov 9th, 2000, 03:24 PM
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?