%@LANGUAGE="VBSCRIPT"%>
<%
Dim rsBrowse
Dim rsBrowse_numRows
Set rsBrowse = Server.CreateObject("ADODB.Recordset")
rsBrowse.ActiveConnection = MM_asp2htm_STRING
rsBrowse.Source = "SELECT ID_News, N_Title, N_FilePath, N_Date,T_TypeName ,N_shibie,N_Type_ID FROM T_News INNER JOIN T_Type ON T_News.N_Type_ID=T_Type.ID_Type ORDER BY N_Date DESC"
rsBrowse.CursorType = 0
rsBrowse.CursorLocation = 2
rsBrowse.LockType = 1
rsBrowse.Open()
rsBrowse_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsBrowse_numRows = rsBrowse_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim rsBrowse_total
Dim rsBrowse_first
Dim rsBrowse_last
' set the record count
rsBrowse_total = rsBrowse.RecordCount
' set the number of rows displayed on this page
If (rsBrowse_numRows < 0) Then
rsBrowse_numRows = rsBrowse_total
Elseif (rsBrowse_numRows = 0) Then
rsBrowse_numRows = 1
End If
' set the first and last displayed record
rsBrowse_first = 1
rsBrowse_last = rsBrowse_first + rsBrowse_numRows - 1
' if we have the correct record count, check the other stats
If (rsBrowse_total <> -1) Then
If (rsBrowse_first > rsBrowse_total) Then
rsBrowse_first = rsBrowse_total
End If
If (rsBrowse_last > rsBrowse_total) Then
rsBrowse_last = rsBrowse_total
End If
If (rsBrowse_numRows > rsBrowse_total) Then
rsBrowse_numRows = rsBrowse_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rsBrowse_total = -1) Then
' count the total records by iterating through the recordset
rsBrowse_total=0
While (Not rsBrowse.EOF)
rsBrowse_total = rsBrowse_total + 1
rsBrowse.MoveNext
Wend
' reset the cursor to the beginning
If (rsBrowse.CursorType > 0) Then
rsBrowse.MoveFirst
Else
rsBrowse.Requery
End If
' set the number of rows displayed on this page
If (rsBrowse_numRows < 0 Or rsBrowse_numRows > rsBrowse_total) Then
rsBrowse_numRows = rsBrowse_total
End If
' set the first and last displayed record
rsBrowse_first = 1
rsBrowse_last = rsBrowse_first + rsBrowse_numRows - 1
If (rsBrowse_first > rsBrowse_total) Then
rsBrowse_first = rsBrowse_total
End If
If (rsBrowse_last > rsBrowse_total) Then
rsBrowse_last = rsBrowse_total
End If
End If
%>