% ' Databaseforbindelse - husk at angive sti til din database Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath ("database.html") Conn.Open DSN strSQL = "Select * from jwnews" set rscount = conn.execute("select count(id) as antal from jwnews") antal = rscount("antal") set rscount = nothing %>
News |
News Added :<%=antal%>
|
<%
PageSize = 9
Conn_String = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.html")
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("
No Script were found
")
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
%>
|
|||
|
Side " & nPageTo & "/" & RS.PageCount & "") Response.Write(" | ") Response.Write("