|
Eli -> RE: Page speed (1/9/2003 16:44:41)
|
my random script looks like this: quote:
<% ' ADO Constant. Dont change this Const adCmdText = &H0001 ' Connection string and SQL statement Dim query, connStr query = " select DatabaseRefNo, EstablishmentName, PostalTown, Description from main WHERE (Country = ' Great Britain' )" connStr = " Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(" databse.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 %> <font color=" #000066" face=" Verdana" size=" 2" > <% Response.Write " <b>" & rs(" EstablishmentName" ) & " , in </b>" %> <% Response.Write " <b>" & rs(" PostalTown" ) & " </b>" %> </font> <p style=" word-spacing: 0; line-height: 100%; margin: 0" ><font color=" #800000" face=" Verdana" size=" 2" > <% Response.Write rs(" Description" ) & " </b>" %> my DRW is getting a DISTINCT WHERE using a drop down. I' ve noticed that my random script comes up quite quickly by itself and then everything else appears, att he same time, some moments later - is this the problem? Its all in the same table.
|
|
|
|