<%
Dim rsblom
Dim rsblom_numRows
Set rsblom = Server.CreateObject("ADODB.Recordset")
rsblom.ActiveConnection = MM_cntrgdrom1_STRING
rsblom.Source = "SELECT Namn, Text, bild FROM vaxter"
rsblom.CursorType = 0
rsblom.CursorLocation = 2
rsblom.LockType = 1
rsblom.Open()
rsblom_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsblom_numRows = rsblom_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim rsblom_total
Dim rsblom_first
Dim rsblom_last
' set the record count
rsblom_total = rsblom.RecordCount
' set the number of rows displayed on this page
If (rsblom_numRows < 0) Then
rsblom_numRows = rsblom_total
Elseif (rsblom_numRows = 0) Then
rsblom_numRows = 1
End If
' set the first and last displayed record
rsblom_first = 1
rsblom_last = rsblom_first + rsblom_numRows - 1
' if we have the correct record count, check the other stats
If (rsblom_total <> -1) Then
If (rsblom_first > rsblom_total) Then
rsblom_first = rsblom_total
End If
If (rsblom_last > rsblom_total) Then
rsblom_last = rsblom_total
End If
If (rsblom_numRows > rsblom_total) Then
rsblom_numRows = rsblom_total
End If
End If
%>
<%
Dim MM_paramName
%>
<%
' *** Move To Record and Go To Record: declare variables
Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined
Dim MM_param
Dim MM_index
Set MM_rs = rsblom
MM_rsCount = rsblom_total
MM_size = rsblom_numRows
MM_uniqueCol = "Namn"
MM_paramName = "id"
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Specific Record: handle detail parameter
If (MM_paramIsDefined And MM_rsCount <> 0) Then
' get the value of the parameter
MM_param = Request.QueryString(MM_paramName)
' find the record with the unique column value equal to the parameter value
MM_offset = 0
Do While (Not MM_rs.EOF)
If (CStr(MM_rs.Fields.Item(MM_uniqueCol).Value) = MM_param) Then
Exit Do
End If
MM_offset = MM_offset + 1
MM_rs.MoveNext
Loop
' if not found, set the number of records and reset the cursor
If (MM_rs.EOF) Then
If (MM_rsCount < 0) Then
MM_rsCount = MM_offset
End If
If (MM_size < 0 Or MM_size > MM_offset) Then
MM_size = MM_offset
End If
MM_offset = 0
' reset the cursor to the beginning
If (MM_rs.CursorType \> 0) Then
MM_rs.MoveFirst
Else
MM_rs.Close
MM_rs.Open
End If
End If
End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range
If (MM_rsCount = -1) Then
' walk to the end of the display range for this page
MM_index = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = MM_index
If (MM_size < 0 Or MM_size > MM_rsCount) Then
MM_size = MM_rsCount
End If
End If
' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If
' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If
' move the cursor to the selected record
MM_index = 0
While (Not MM_rs.EOF And MM_index < MM_offset)
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats
' set the first and last displayed record
rsblom_first = MM_offset + 1
rsblom_last = MM_offset + MM_size
If (MM_rsCount <> -1) Then
If (rsblom_first > MM_rsCount) Then
rsblom_first = MM_rsCount
End If
If (rsblom_last > MM_rsCount) Then
rsblom_last = MM_rsCount
End If
End If
' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (rsblom_total = -1) Then
' count the total records by iterating through the recordset
rsblom_total=0
While (Not rsblom.EOF)
rsblom_total = rsblom_total + 1
rsblom.MoveNext
Wend
' reset the cursor to the beginning
If (rsblom.CursorType > 0) Then
rsblom.MoveFirst
Else
rsblom.Requery
End If
' set the number of rows displayed on this page
If (rsblom_numRows < 0 Or rsblom_numRows > rsblom_total) Then
rsblom_numRows = rsblom_total
End If
' set the first and last displayed record
rsblom_first = 1
rsblom_last = rsblom_first + rsblom_numRows - 1
If (rsblom_first > rsblom_total) Then
rsblom_first = rsblom_total
End If
If (rsblom_last > rsblom_total) Then
rsblom_last = rsblom_total
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>
<div id="Layer2" style="position:absolute; left:40px; top:80px; width:370px; height:160px; z-index:2; overflow: auto;"><%=(rsblom.Fields.Item("Text").Value)%></div>
<div id="Layer3" style="position:absolute; left:410px; top:50px; width:158px; height:160px; z-index:3"><%=(rsblom.Fields.Item("bild").Value)%></div>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsblom.EOF))
%>
<a href="#"><%=(rsblom.Fields.Item("Namn").Value)%> </a>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsblom.MoveNext()
Wend
%>
</body>
</html>
<%
rsblom.Close()
Set rsblom = Nothing
%>