<% '古いデータを削除 Dim dtmCurrent,nyear,nmonth,nday,str_day,str_month dtmCurrent = Now Set DataConn = Server.CreateObject("ADODB.Connection") DataConn.Open "regist1" Set DataCmd = Server.CreateObject("ADODB.Command") Set DataCmd.ActiveConnection = DataConn '!!!!!!!!!!!!!!!!!!!!!!!!!!!! confirm plz str_day = Day(dtmCurrent) str_month = Month(dtmCurrent) If CInt(str_day) < 10 Then str_day = "0" & str_day end if If CInt(str_month) < 10 Then str_month = "0" & str_month end if DataCmd.CommandText = "DELETE * FROM noticebd6 WHERE iyear <= '" & Year(dtmCurrent) & "' AND iday < '" & str_day & "' AND imonth <= '" & str_month & "'" 'DataCmd.CommandText = "DELETE * FROM noticebd6 WHERE iyear <= '" & Year(dtmCurrent) & " ' AND imonth <= '" & Month(dtmCurrent) &" ' AND iday < '"& Day(dtmCurrent) &" ' " Set regist_main = DataCmd.Execute DataConn.Close Set DataConn = Nothing %> <% '登録されたデータを新しいものから表示する Dim i i = 0 Set DataConn = Server.CreateObject("ADODB.Connection") DataConn.Open "regist1" Set DataCmd = Server.CreateObject("ADODB.Command") Set DataCmd.ActiveConnection = DataConn DataCmd.CommandText = "SELECT * FROM noticebd6 order by ID desc" Set regist_main = Server.CreateObject("ADODB.Recordset") Set regist_main = DataCmd.Execute %> <% Do While i < 3 AND NOT regist_main.EOF Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("
") Response.Write("
") Response.Write("

") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("
") Response.Write("") Response.Write("
") Response.Write("この情報は、") Response.Write(regist_main("iyear") & "年") Response.Write(regist_main("imonth") & "月") Response.Write(regist_main("iday") & "日まで掲載されます。") Response.Write("") Response.Write("
" & regist_main("title") &"" & regist_main("subtitle") &"
") Response.Write(regist_main("comment1")) Response.Write(regist_main("comment2")) Response.Write(regist_main("comment3")) Response.Write(regist_main("comment4")) Response.Write("
") Response.Write("" & regist_main("url") & "") Response.Write("
") Response.Write("

") Response.Write("
お問合せ先/担当" & regist_main("name") & "まで
") Response.Write(regist_main("tel1") & "-") Response.Write(regist_main("tel2") & "-") Response.Write(regist_main("tel3") & "
") Response.Write("

") Response.Write("


") regist_main.MoveNext i = i +1 Loop %>

<% If NOT regist_main.EOF Then 'Response.Write("
") 'Response.Write("") 'Response.Write("") Response.Write("次画面へ") Response.Write("
") End If %>