home *** CD-ROM | disk | FTP | other *** search
- <%
-
- Recordset1_total = Recordset.RecordCount
-
- If (Recordset1_numRows < 0) Then
- Recordset1_numRows = Recordset1_total
- Elseif (Recordset1_numRows = 0) Then
- Recordset1_numRows = 1
- End If
-
- Recordset1_first = 1
- Recordset1_last = Recordset1_first + Recordset1_numRows - 1
-
- If (Recordset1_total <> -1) Then
- If (Recordset1_first > Recordset1_total) Then Recordset1_first = Recordset1_total
- If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total
- If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total
- End If
- %>
- <%
-
- Set DTBA_rs = Recordset
- DTBA_rsCount = Recordset1_total
- DTBA_size = Recordset1_numRows
- DTBA_uniqueCol = ""
- DTBA_paramName = ""
- DTBA_offset = 0
- DTBA_atTotal = false
- DTBA_paramIsDefined = false
- If (DTBA_paramName <> "") Then
- DTBA_paramIsDefined = (Request.QueryString(DTBA_paramName) <> "")
- End If
- %>
- <%
-
- if (Not DTBA_paramIsDefined And DTBA_rsCount <> 0) then
-
- r = Request.QueryString("index")
- If r = "" Then r = Request.QueryString("offset")
- If r <> "" Then DTBA_offset = Int(r)
-
- If (DTBA_rsCount <> -1) Then
- If (DTBA_offset >= DTBA_rsCount Or DTBA_offset = -1) Then
- If ((DTBA_rsCount Mod DTBA_size) > 0) Then
- DTBA_offset = DTBA_rsCount - (DTBA_rsCount Mod DTBA_size)
- Else
- DTBA_offset = DTBA_rsCount - DTBA_size
- End If
- End If
- End If
-
- i = 0
- While ((Not DTBA_rs.EOF) And (i < DTBA_offset Or DTBA_offset = -1))
- DTBA_rs.MoveNext
- i = i + 1
- Wend
- If (DTBA_rs.EOF) Then DTBA_offset = i
-
- End If
- %>
- <%
-
- If (DTBA_rsCount = -1) Then
-
- i = DTBA_offset
- While (Not DTBA_rs.EOF And (DTBA_size < 0 Or i < DTBA_offset + DTBA_size))
- DTBA_rs.MoveNext
- i = i + 1
- Wend
-
- If (DTBA_rs.EOF) Then
- DTBA_rsCount = i
- If (DTBA_size < 0 Or DTBA_size > DTBA_rsCount) Then DTBA_size = DTBA_rsCount
- End If
-
- If (DTBA_rs.EOF And Not DTBA_paramIsDefined) Then
- If (DTBA_offset > DTBA_rsCount - DTBA_size Or DTBA_offset = -1) Then
- If ((DTBA_rsCount Mod DTBA_size) > 0) Then
- DTBA_offset = DTBA_rsCount - (DTBA_rsCount Mod DTBA_size)
- Else
- DTBA_offset = DTBA_rsCount - DTBA_size
- End If
- End If
- End If
-
- If (DTBA_rs.CursorType > 0) Then
- DTBA_rs.MoveFirst
- Else
- DTBA_rs.Requery
- End If
-
- i = 0
- While (Not DTBA_rs.EOF And i < DTBA_offset)
- DTBA_rs.MoveNext
- i = i + 1
- Wend
- End If
- %>
- <%
-
- Recordset1_first = DTBA_offset + 1
- Recordset1_last = DTBA_offset + DTBA_size
- If (DTBA_rsCount <> -1) Then
- If (Recordset1_first > DTBA_rsCount) Then Recordset1_first = DTBA_rsCount
- If (Recordset1_last > DTBA_rsCount) Then Recordset1_last = DTBA_rsCount
- End If
-
- DTBA_atTotal = (DTBA_rsCount <> -1 And DTBA_offset + DTBA_size >= DTBA_rsCount)
- %>
- <%
-
- DTBA_removeList = "&index="
- If (DTBA_paramName <> "") Then DTBA_removeList = DTBA_removeList & "&" & DTBA_paramName & "="
- DTBA_keepURL="":DTBA_keepForm="":DTBA_keepBoth="":DTBA_keepNone=""
-
- For Each Item In Request.QueryString
- NextItem = "&" & Item & "="
- If (InStr(1,DTBA_removeList,NextItem,1) = 0) Then
- DTBA_keepURL = DTBA_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
- End If
- Next
-
- For Each Item In Request.Form
- NextItem = "&" & Item & "="
- If (InStr(1,DTBA_removeList,NextItem,1) = 0) Then
- DTBA_keepForm = DTBA_keepForm & NextItem & Server.URLencode(Request.Form(Item))
- End If
- Next
-
- DTBA_keepBoth = DTBA_keepURL & DTBA_keepForm
- if (DTBA_keepBoth <> "") Then DTBA_keepBoth = Right(DTBA_keepBoth, Len(DTBA_keepBoth) - 1)
- if (DTBA_keepURL <> "") Then DTBA_keepURL = Right(DTBA_keepURL, Len(DTBA_keepURL) - 1)
- if (DTBA_keepForm <> "") Then DTBA_keepForm = Right(DTBA_keepForm, Len(DTBA_keepForm) - 1)
-
- Function DTBA_joinChar(firstItem)
- If (firstItem <> "") Then
- DTBA_joinChar = "&"
- Else
- DTBA_joinChar = ""
- End If
- End Function
- %>
- <%
-
- DTBA_keepMove = DTBA_keepBoth
- DTBA_moveParam = "index"
-
- If (DTBA_size > 0) Then
- DTBA_moveParam = "offset"
- If (DTBA_keepMove <> "") Then
- params = Split(DTBA_keepMove, "&")
- DTBA_keepMove = ""
- For i = 0 To UBound(params)
- nextItem = Left(params(i), InStr(params(i),"=") - 1)
- If (StrComp(nextItem,DTBA_moveParam,1) <> 0) Then
- DTBA_keepMove = DTBA_keepMove & "&" & params(i)
- End If
- Next
- If (DTBA_keepMove <> "") Then
- DTBA_keepMove = Right(DTBA_keepMove, Len(DTBA_keepMove) - 1)
- End If
- End If
- End If
-
- If (DTBA_keepMove <> "") Then DTBA_keepMove = DTBA_keepMove & "&"
- urlStr = Request.ServerVariables("URL") & "?" & DTBA_keepMove & DTBA_moveParam & "="
- DTBA_moveFirst = urlStr & "0"
- DTBA_moveLast = urlStr & "-1"
- DTBA_moveNext = urlStr & Cstr(DTBA_offset + DTBA_size)
- prev = DTBA_offset - DTBA_size
- If (prev < 0) Then prev = 0
- DTBA_movePrev = urlStr & Cstr(prev)
- %>