<% OpenDatabase dim page_no dim searchKey dim searchType dim ListArg,ViewArg nPage = trim(request("page_no")) searchKey = trim(request("searchKey")) searchType = trim(request("searchType")) if len(nPage) = 0 then nPage = 1 end if ListArg = "page_no="&nPage&"&searchType="&searchType&"&searchKey="&searchKey %> ::: 바비젼 :::
 
 
 
Home > 뉴스

<% Dim pageView, notpageView Dim countSql, countRs pageView = 10 '페이지당 보여질 글 수 notpageView = pageView*(nPage-1) if searchType<>"" And searchKey<>"" Then WhereSql = " Where " & searchType & " like '%" & searchKey & "%'" AndSql = " And " & searchType & " like '%" & searchKey & "%'" End if '========= 전체 카운트 및 마지막 카운트 =============== countSQL = "Select Count(*) ,CEILING(CAST(Count(*) AS FLOAT)/" & pageView & ") " _ & " from TB_NEWS " & WhereSql set countRs = DbCon.Execute (countSQL) if countRs(0) = 0 then rsMsg="조회된 데이터가 없습니다." else nLast = countRs(1) totrecord = countRs(0) end if Set countRs = nothing '========= 전체 카운트 및 마지막 카운트 =============== '============ 내용 가져오기 ===================== Set Rs = Server.CreateObject("Adodb.RecordSet") SQL = "SELECT TOP " & pageView & " * FROM TB_NEWS " SQL = SQL & " Where Sno Not in " SQL = SQL & "(SELECT TOP " & notpageView & " sno FROM TB_NEWS " & WhereSql SQL = SQL & " Order By Sno desc) " & AndSql SQL = SQL & " Order By Sno desc" 'Response.Write SQL Rs.Open SQL,DbCon,1 '============ 내용 가져오기 ===================== CurPage = nPage - 1 n=totrecord - CurPage * pageView Dim i i= (CurPage * pageView) + 1 if Not Rs.EOF And Not Rs.BOF then do until Rs.EOF sNo = Rs("sno") name = Trim(Rs("name")) title = split_string(Trim(Rs("title")),40) readcnt = Rs("readcnt") reg_dt = left(Rs("reg_dt"),10) ViewArg ="sNo="&sNo&"&searchType="&searchType&"&searchKey="&searchKey&"&page_no="&nPage todaydate = GetCurDate() tp_regdt = Replace(reg_dt,"-","") %> <% Rs.Movenext i = i + 1 n = n-1 Loop Else %> <% end if Rs.Close set Rs = nothing %>
번호
제 목
작성자
등록일
조회수
<%=n%> <%=title%> <% if todaydate = tp_regdt then %> <% end if %> <%=name%> <%=reg_dt%> <%=readcnt%>
<%=rsMsg%>
<% page_link = "n_list.htm?searchKey="&searchKey&"&searchType="&searchType %>
<% CloseDataBase %>