<%
PageSize = 5
Conn_String = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../../database/sitenews.mdb")
If Request("PageTo") <> "" Then
strPageTo = Request("PageTo")
If strPageTo <> "" Then
nPageTo = int(strPageTo)
If nPageTo < 1 Then
nPageTo = 1
End If
Else
nPageTo = 1
End If
Set RS = Session("ListingRS")
RS.AbsolutePage = nPageTo
else
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout=15
Conn.CommandTimeout=30
Conn.Open Conn_String
Set Cmd=Server.CreateObject("ADODB.Command")
Set RS=Server.CreateObject("ADODB.Recordset")
Cmd.CommandType = 1
Set Cmd.ActiveConnection = Conn
Cmd.CommandText="SELECT * From jwnews order by ID desc;"
RS.Open Cmd, , 1, 1
RS.PageSize = PageSize
Set Session("ListingRS") = RS
nPageTo = 1
If not (RS.BOF and RS.EOF) Then
Set RS = Session("ListingRS")
RS.AbsolutePage = nPageTo
End If
end if
If RS.EOF Then
Response.Write("
Der er ingen nyheder i databasen
")
Else
nRowCount = RS.PageSize
While not RS.EOF and nRowCount > 0
Count = 0
for i = 1 to Count
next
dagar=DateDiff("d", Dato, RS("Dato"))+2
if dagar >= 0 then
%>
<%=rs("navn")%>
|
Tilføjet kl. <% = rs("kl") %>
d. <% = rs("dato") %>
|
<%
end if
nRowCount = nRowCount - 1
RS.MoveNext
Wend
'conn.close
'Display Paging Buttons
Response.Write("
")
' Display <<
Response.Write(vbcr & "")
' Display <
Response.Write(vbcr & "")
' Display >
Response.Write(vbcr & "")
' Display >>
Response.Write(vbcr & "")
Response.Write("
")
Response.Write("")
Response.Write("Side " & nPageTo & "/" & RS.PageCount & "")
Response.Write(" | ")
Response.Write("
")
Response.Write("
")
end if
%>