%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Dim rs1__MMColParam rs1__MMColParam = "1" If (Request.QueryString("id") <> "") Then rs1__MMColParam = Request.QueryString("id") End If %> <% Dim rs1 Dim rs1_numRows Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.ActiveConnection = MM_Con_sprep_STRING rs1.Source = "SELECT * FROM v_publication WHERE id = " + Replace(rs1__MMColParam, "'", "''") + " and flg_publish =true " rs1.CursorType = 0 rs1.CursorLocation = 2 rs1.LockType = 1 rs1.Open() rs1_numRows = 0 %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim rs1_total Dim rs1_first Dim rs1_last ' set the record count rs1_total = rs1.RecordCount ' set the number of rows displayed on this page If (rs1_numRows < 0) Then rs1_numRows = rs1_total Elseif (rs1_numRows = 0) Then rs1_numRows = 1 End If ' set the first and last displayed record rs1_first = 1 rs1_last = rs1_first + rs1_numRows - 1 ' if we have the correct record count, check the other stats If (rs1_total <> -1) Then If (rs1_first > rs1_total) Then rs1_first = rs1_total End If If (rs1_last > rs1_total) Then rs1_last = rs1_total End If If (rs1_numRows > rs1_total) Then rs1_numRows = rs1_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rs1_total = -1) Then ' count the total records by iterating through the recordset rs1_total=0 While (Not rs1.EOF) rs1_total = rs1_total + 1 rs1.MoveNext Wend ' reset the cursor to the beginning If (rs1.CursorType > 0) Then rs1.MoveFirst Else rs1.Requery End If ' set the number of rows displayed on this page If (rs1_numRows < 0 Or rs1_numRows > rs1_total) Then rs1_numRows = rs1_total End If ' set the first and last displayed record rs1_first = 1 rs1_last = rs1_first + rs1_numRows - 1 If (rs1_first > rs1_total) Then rs1_first = rs1_total End If If (rs1_last > rs1_total) Then rs1_last = rs1_total End If End If %>
<% rs1.Close() Set rs1 = Nothing %>