%@LANGUAGE="VBSCRIPT"%> <% Dim Recordset_photos Dim Recordset_photos_numRows Set Recordset_photos = Server.CreateObject("ADODB.Recordset") Recordset_photos.ActiveConnection = MM_vera_STRING Recordset_photos.Source = "SELECT * FROM magazine ORDER BY id DESC" Recordset_photos.CursorType = 0 Recordset_photos.CursorLocation = 2 Recordset_photos.LockType = 1 Recordset_photos.Open() Recordset_photos_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 Recordset_photos_numRows = Recordset_photos_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Recordset_photos_total Dim Recordset_photos_first Dim Recordset_photos_last ' set the record count Recordset_photos_total = Recordset_photos.RecordCount ' set the number of rows displayed on this page If (Recordset_photos_numRows < 0) Then Recordset_photos_numRows = Recordset_photos_total Elseif (Recordset_photos_numRows = 0) Then Recordset_photos_numRows = 1 End If ' set the first and last displayed record Recordset_photos_first = 1 Recordset_photos_last = Recordset_photos_first + Recordset_photos_numRows - 1 ' if we have the correct record count, check the other stats If (Recordset_photos_total <> -1) Then If (Recordset_photos_first > Recordset_photos_total) Then Recordset_photos_first = Recordset_photos_total End If If (Recordset_photos_last > Recordset_photos_total) Then Recordset_photos_last = Recordset_photos_total End If If (Recordset_photos_numRows > Recordset_photos_total) Then Recordset_photos_numRows = Recordset_photos_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Recordset_photos_total = -1) Then ' count the total records by iterating through the recordset Recordset_photos_total=0 While (Not Recordset_photos.EOF) Recordset_photos_total = Recordset_photos_total + 1 Recordset_photos.MoveNext Wend ' reset the cursor to the beginning If (Recordset_photos.CursorType > 0) Then Recordset_photos.MoveFirst Else Recordset_photos.Requery End If ' set the number of rows displayed on this page If (Recordset_photos_numRows < 0 Or Recordset_photos_numRows > Recordset_photos_total) Then Recordset_photos_numRows = Recordset_photos_total End If ' set the first and last displayed record Recordset_photos_first = 1 Recordset_photos_last = Recordset_photos_first + Recordset_photos_numRows - 1 If (Recordset_photos_first > Recordset_photos_total) Then Recordset_photos_first = Recordset_photos_total End If If (Recordset_photos_last > Recordset_photos_total) Then Recordset_photos_last = Recordset_photos_total End If End If %>
![]() |
|
| about us | magazine | contact |
| Copyright © Aslan Ruso |