Untitled Document
<%
if not IsNumeric(show_stories) then
show_stories = "999"
end if
Set dConn = Server.CreateObject("ADODB.Connection")
dConn.Open "PROVIDER=Microsoft.ACE.OLEDB.12.0;DATA SOURCE=" & database_path
strSQL = "SELECT TOP " & show_stories & " expire, id, newsdate, newstitle, newsbody from tblnews where active = 1 and #" & todaydate & "# < expire and category='agenda' order by newsdate asc, id;"
'response.write strSQL
Set newsRS = Server.CreateObject("ADODB.recordset")
newsRS.Open strSQL, dConn, 1, 3
recordcount = newsRS.recordcount
if recordcount < 1 then
newsRS.Close
Set newsRS = Nothing
response.write(errormsg2 & loginlink)
response.end
end if
'newsRS.GetRows()
'Data is retrieved so close all connections
'Setup for array usage
%>
<%
' Loop through the records (second dimension of the array)
'sysdate, systime, newsdate,newstitle, newsbody, active, expire
newsRS.MoveFirst ' move to first record
If Not newsRS.BOF or newsRS.EOF Then
Do While Not newsRS.Eof
news_expire = newsRS("expire")
news_id = newsRS("id")
news_dat = newsRS("newsdate")
news_title = newsRS("newstitle")
news_body = newsRS("newsbody")
response.write "
" & _
"
" & news_dat & " " & news_title & "
" & _
"
" & _
"
" & _
"
" & news_body & "
" & _
"
"
newsRS.MoveNext ' don't forget to increment the file pointer
Loop
' we have some records returned
Else
' No records returned
End If
newsRS.Close
Set newsRS = Nothing
dconn.close
Set dconn = nothing
%>