<% Dim conn, rs, Provider, DBPath, SQL Set conn = Server.CreateObject("ADODB.Connection") Provider = "Provider=Microsoft.Jet.OLEDB.4.0;" DBPath = "Data Source=" & Server.MapPath("SysDB.mdb") conn.Open Provider & DBPath %> 台灣敏愛蝶古巴特-最新消息 Taiwan MingAi Decoupage-News
 
<% Set rs = Server.CreateObject("ADODB.Recordset") SQL = "Select * from News where showit='Y' order by posttime Desc" rs.Open SQL,conn,3,3 If rs.RecordCount = 0 then %>
目前尚無任何公告訊息!
<% Else %> <% rs.MoveFirst While Not rs.EOF %> <% If Month(rs("posttime")) < 10 then MonthVal = "0" & Month(rs("posttime")) Else MonthVal = Month(rs("posttime")) End If If Day(rs("posttime")) < 10 then DayVal = "0" & Day(rs("posttime")) Else DayVal = Day(rs("posttime")) End If If DateDiff("d", rs("posttime"), Now) < 4 then %> <% rs.MoveNext Wend %>
  <%=Year(rs("posttime"))%>/<%=MonthVal%>/<%=DayVal%>  " target="_self"><%=rs("subject")%> <% Else %>   <%=Year(rs("posttime"))%>/<%=MonthVal%>/<%=DayVal%>  " target="_self"><%=rs("subject")%> <% End If %>
<% End If %> <% set conn=nothing set rs=nothing %>