%@LANGUAGE="VBSCRIPT"%> <% Dim used_stock Dim used_stock_cmd Dim used_stock_numRows Set used_stock_cmd = Server.CreateObject ("ADODB.Command") used_stock_cmd.ActiveConnection = MM_atvworld_STRING used_stock_cmd.CommandText = "SELECT * FROM Products WHERE Website LIKE '%1' ORDER BY ProductID DESC" used_stock_cmd.Prepared = true Set used_stock = used_stock_cmd.Execute used_stock_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = -1 Repeat1__index = 0 used_stock_numRows = used_stock_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim used_stock_total Dim used_stock_first Dim used_stock_last ' set the record count used_stock_total = used_stock.RecordCount ' set the number of rows displayed on this page If (used_stock_numRows < 0) Then used_stock_numRows = used_stock_total Elseif (used_stock_numRows = 0) Then used_stock_numRows = 1 End If ' set the first and last displayed record used_stock_first = 1 used_stock_last = used_stock_first + used_stock_numRows - 1 ' if we have the correct record count, check the other stats If (used_stock_total <> -1) Then If (used_stock_first > used_stock_total) Then used_stock_first = used_stock_total End If If (used_stock_last > used_stock_total) Then used_stock_last = used_stock_total End If If (used_stock_numRows > used_stock_total) Then used_stock_numRows = used_stock_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (used_stock_total = -1) Then ' count the total records by iterating through the recordset used_stock_total=0 While (Not used_stock.EOF) used_stock_total = used_stock_total + 1 used_stock.MoveNext Wend ' reset the cursor to the beginning If (used_stock.CursorType > 0) Then used_stock.MoveFirst Else used_stock.Requery End If ' set the number of rows displayed on this page If (used_stock_numRows < 0 Or used_stock_numRows > used_stock_total) Then used_stock_numRows = used_stock_total End If ' set the first and last displayed record used_stock_first = 1 used_stock_last = used_stock_first + used_stock_numRows - 1 If (used_stock_first > used_stock_total) Then used_stock_first = used_stock_total End If If (used_stock_last > used_stock_total) Then used_stock_last = used_stock_total End If End If %>
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||