this script is great, I modified it to output a table with to fields.
can you help me make the total number of records NOT LESS than 6 or 8 ?
here is what I did:
<%
Option Explicit
Response.Buffer = True
%>
<html>
<head>
<style>
p { font-family:verdana; font-size:11px; }
</style>
</head>
<body>
<br><p align="center">
<%
' ADO Constant. Dont change this
Const adCmdText = &H0001
%>
<CENTER>
<FONT FACE='Verdana'>
<TABLE BORDER=1 CELLPADDING=2 CELLSPACING=0 style="border-collapse: collapse" bordercolor="#111111">
<TR BGCOLOR=#000080>
<TD ALIGN=CENTER bgcolor="#C0C0C0">
<FONT COLOR=#FFFFFF SIZE=2>
A
</FONT>
</TD>
<TD ALIGN=CENTER bgcolor="#C0C0C0">
<FONT COLOR=#FFFFFF SIZE=2>
B
</FONT>
</TD>
</TR>
<%
' Connection string and SQL statement
Dim query, connStr
query = "select company_name,company_toll from table2"
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("guestbook.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(rs.RecordCount*rnd))
rs.Move intRnd
'Loop through the recordset
Do While not rs.EOF
%>
<TR>
<TD>
<FONT SIZE=1>
<%Response.Write rs("company_name") %>
</FONT>
</TD>
<TD>
<FONT SIZE=1>
<%Response.Write rs("company_toll") %>
</FONT>
</TD>
</TR>
<%
'Move to the next record in the recordset
rs.MoveNext
Loop
' Closing the database
rs.Close
Set rs = Nothing
%>
</TABLE>
</p>
</body>
</html>