<%
dim con 'Connection variable
dim RS 'Recordset name
dim UpdateDate
dim newsDate
dim NewEvent
call Conn
call UpdateDt
Sub Conn
set con = server.CreateObject("Adodb.Connection")
'Con.Open "dsn=excise1;server=rsbcltest","excise","excise"
con.open "dsn=excise","excise","excise"
End sub
sub updateDt
Set Rs = Server.CreateObject("Adodb.Recordset")
SQL=" select to_char(UPDATE_DATE,'Month')|| to_char(UPDATE_DATE,'DD')||','||to_char(UPDATE_DATE,'YYYY') date1 " &_
" from UPDATE_DATE_ENTRY where UPDATE_DATE=(Select max(UPDATE_DATE) from UPDATE_DATE_ENTRY) "
'Response.Write SQL
Rs.Open SQL,con,3,2
if not RS.eof then
UpdateDate=Rs(0)
end if
RS.close
SQL=" select title,file_attachment,to_char(start_date,'ddmmyyyy') ,to_char(start_date,'Month')|| to_char(start_date,'DD')||','||to_char(start_date,'YYYY') date1 " &_
" from news where display='Y' and to_date(start_date) <= to_date(sysdate) " &_
" and to_date(end_date)>= to_date(sysdate) and del_flag='N' order by start_date,id"
NewEvent=""
' Response.Write SQL
Rs.Open SQL,con,3,2
dim date1,date2
date2=""
while not RS.eof
date1=Rs(2)
if date1 <> date2 and date2 <> "" then
NewEvent= NewEvent & "!"
end if
NewEvent= NewEvent & Rs(0) & "$" & Rs(1)& "$" & Rs(2)& "$" & Rs(3) & "@"
date2=Rs(2)
RS.MoveNext
wend
NewEvent= NewEvent & "!"
RS.close
SQL=" select to_char(start_date,'Month')|| to_char(start_date,'DD')||','||to_char(start_date,'YYYY') date1 " &_
" from news where start_date=(Select max(start_date) from news) and del_flag='N' "
'Response.Write SQL
Rs.Open SQL,con,3,2
if not RS.eof then
newsDate=Rs(0)
end if
RS.close
con.Cancel
End sub
%>