<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Dim image1 Dim image1_numRows Set image1 = Server.CreateObject("ADODB.Recordset") image1.ActiveConnection = MM_mjballantyne_STRING image1.Source = "SELECT image1 FROM dbo.homepageimages" image1.CursorType = 0 image1.CursorLocation = 2 image1.LockType = 1 image1.Open() image1_numRows = 0 %> <% Dim image2 Dim image2_numRows Set image2 = Server.CreateObject("ADODB.Recordset") image2.ActiveConnection = MM_mjballantyne_STRING image2.Source = "SELECT image2 FROM dbo.homepageimages" image2.CursorType = 0 image2.CursorLocation = 2 image2.LockType = 1 image2.Open() image2_numRows = 0 %> <% Dim image3 Dim image3_numRows Set image3 = Server.CreateObject("ADODB.Recordset") image3.ActiveConnection = MM_mjballantyne_STRING image3.Source = "SELECT image3 FROM dbo.homepageimages" image3.CursorType = 0 image3.CursorLocation = 2 image3.LockType = 1 image3.Open() image3_numRows = 0 %> <% ' Moving to random record - Steven Jones' Extension If Not(image3.bof and image3.eof) Then ' reset the cursor to the beginning If (image3.CursorType > 0) Then image3.MoveFirst Else image3.Requery End If image3_totalrn = -1 image3_totalrn = image3.RecordCount ' ony works on some recordsets, but much faster If (image3_totalrn = -1) Then ' and if it didn't work, we still have to count the records. ' count the total records by iterating through the recordset image3_totalrn=0 While (Not image3.EOF) image3_totalrn = image3_totalrn + 1 image3.MoveNext Wend ' reset the cursor to the beginning If (image3.CursorType > 0) Then image3.MoveFirst Else image3.Requery End If End If ' now do final adjustments, and move to the random record image3_totalrn = image3_totalrn - 1 If image3_totalrn > 0 Then Randomize image3.Move Int((image3_totalrn + 1) * Rnd) End If End If ' all done; you should always check for an empty recordset before displaying data %> <% ' Moving to random record - Steven Jones' Extension If Not(image2.bof and image2.eof) Then ' reset the cursor to the beginning If (image2.CursorType > 0) Then image2.MoveFirst Else image2.Requery End If image2_totalrn = -1 image2_totalrn = image2.RecordCount ' ony works on some recordsets, but much faster If (image2_totalrn = -1) Then ' and if it didn't work, we still have to count the records. ' count the total records by iterating through the recordset image2_totalrn=0 While (Not image2.EOF) image2_totalrn = image2_totalrn + 1 image2.MoveNext Wend ' reset the cursor to the beginning If (image2.CursorType > 0) Then image2.MoveFirst Else image2.Requery End If End If ' now do final adjustments, and move to the random record image2_totalrn = image2_totalrn - 1 If image2_totalrn > 0 Then Randomize image2.Move Int((image2_totalrn + 1) * Rnd) End If End If ' all done; you should always check for an empty recordset before displaying data %> <% ' Moving to random record - Steven Jones' Extension If Not(image1.bof and image1.eof) Then ' reset the cursor to the beginning If (image1.CursorType > 0) Then image1.MoveFirst Else image1.Requery End If image1_totalrn = -1 image1_totalrn = image1.RecordCount ' ony works on some recordsets, but much faster If (image1_totalrn = -1) Then ' and if it didn't work, we still have to count the records. ' count the total records by iterating through the recordset image1_totalrn=0 While (Not image1.EOF) image1_totalrn = image1_totalrn + 1 image1.MoveNext Wend ' reset the cursor to the beginning If (image1.CursorType > 0) Then image1.MoveFirst Else image1.Requery End If End If ' now do final adjustments, and move to the random record image1_totalrn = image1_totalrn - 1 If image1_totalrn > 0 Then Randomize image1.Move Int((image1_totalrn + 1) * Rnd) End If End If ' all done; you should always check for an empty recordset before displaying data %> M & J BALLANTYNE: Quality Builders
M & J Ballantyne Ltd, Quality Builders

NHBC Registered
 
 

 

 

© M&J Ballantyne Ltd Copyright 2010 | Site Map | Disclaimer | Privacy | Site Administration

NHBC Registered <% image1.Close() Set image1 = Nothing %> <% image2.Close() Set image2 = Nothing %> <% image3.Close() Set image3 = Nothing %>