Nyhetsarkiv

<% dim DB set DB = Server.CreateObject ("ADODB.Connection") DB.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & "DBQ=" & server.mappath("Dbase/nyheter.mdb") dim ID ID = request.querystring("ID") if ID <> "" then set RS = DB.execute("SELECT * FROM [nyhet] WHERE [id] = " & id & " ORDER BY [dato] DESC") if not (RS.EOF) then response.write "

" & RS.Fields ("tittel") & "

" & vbCrLf response.write RS.Fields ("tekst") & vbCrLf response.write "
" & FormatDateTime(RS.Fields ("dato"), vbLongDate) & " - postet av " & RS.Fields ("forfatter") & "
" & vbCrLf & vbCrLf end if else set RS = DB.execute("SELECT * FROM [nyhet] ORDER BY [dato] DESC") if not (RS.EOF) then RS.MoveFirst while not RS.EOF response.write "

" & RS.Fields ("tittel") & "

" & vbCrLf response.write RS.Fields ("tekst") & vbCrLf response.write "
" & FormatDateTime(RS.Fields ("dato"), vbLongDate) & "
" & vbCrLf & vbCrLf RS.MoveNext wend end if end if DB.close %>