<%=headerPage%>
<% page = trim(request.querystring("page")) Dim strLine If page = "" Then page = 1 else page = cint(page) End If DisplayNum = 0 Set oCon = Server.CreateObject ("ADODB.Connection") Set Rec = Server.CreateObject ("ADODB.Recordset") oCon.Open strCon Rec.PageSize = 10 Rec.CursorLocation = adUseClient sql = "Select newsID, headline, source, summary, newsDate from news where status = 1 AND " sql = sql & " DateDiff(""n"", newsDate, Now()) >= 0 order by newsDate desc" Rec.Open sql, oCon if Rec.EOF OR Rec.BOF Then response.write "

" response.write "

Sorry, There is no news ...

" else ipage = Rec.PageCount if page = 0 or page > ipage Then Rec.AbsolutePage = ipage else Rec.AbsolutePage = page end if do while not Rec.Eof AND i < 10 response.write "" & Rec("headline") & "
" & vbcrlf response.write ""& vbcrlf response.write "Publish Date : " & Rec("newsDate") & "   Source : "& rec("source") &"
"& vbcrlf response.write ""& vbcrlf response.write Rec("summary") & "

"& vbcrlf & vbcrlf & vbcrlf i = i + 1 Rec.Movenext loop response.write ""& vbcrlf response.write "Total Results : " & Rec.RecordCount & "  " If ipage > 1 Then showpages = "
More Pages :  " For z = 1 to ipage If z = page then showpages = showpages & "  [" & page & "]  " Else showpages = showpages & " " & z & "" & "  " End If Next response.write showpages & "  " End If if ipage > 1 And page > 1 Then response.write "Previous" end if response.write "  " If ipage > 1 And page < ipage Then response.write "Next Page" end if response.write "
" Rec.Close oCon.Close set Rec = nothing set oCon = nothing End if %>
<%=footerPage%>