% dim v_search, v_keyword, table, Query_Fields, Query_Where, Query_OrderBy Dim recordcount dim pagesize, v_totalpage, v_page, TotalCnt, v_block v_search = inputValue( Request.QueryString("p_search") ) '검색조건 v_keyword = inputValue( Request.QueryString("p_keyword") ) '검색어 prepage = Request.ServerVariables("path_info") & "?" & Request.ServerVariables("query_string") '현재페이지경로 table = "SDK_MMS_SEND" '테이블 idx_field = "MSG_ID" '기본키 oreder_filed = "SEND_DATE desc" '정렬기준 필드 Query_Fields = "MSG_ID, SEND_DATE, MMS_MSG, DEST_INFO" '불러올 필드 pagesize = 12 '목록개수 v_block = 10 '페이지개수 now_date = Replace( Date(), "-", "" ) & Right("0"&hour(now), 2) & Right("0"&minute(now), 2) & Right("0"&second(now), 2) '==================조합 쿼리문======================= If v_keyword <> "" then Query_Where = " where schedule_type = 1 and user_id = '" & session("ss_m_id") & "' and send_date >= '"& now_date &"' and " & v_search & " like '%" & v_keyword & "%'" andOrWhere = " and " Else Query_Where = " where schedule_type = 1 and user_id = '" & session("ss_m_id") & "' and send_date >= '"& now_date &"'" andOrWhere = " and " End if Query_OrderBy = " ORDER BY "&oreder_filed '==================조합 쿼리문======================= '==================전체 레코드 수 뽑기=============== sql="select count(*) from " & table & Query_Where set rs = DbCon.execute(sql) recordcount=CInt( rs(0) ) '이 전체레코드갯수를 이용해서 페이지갯수를 뽑아 낼것이다. Set rs = nothing '==================전체 레코드 수 뽑기=============== v_totalpage=fix((recordcount-1)/pagesize)+1 '전체덩어리갯수 v_page = Request.QueryString("p_page") if v_page="" then v_page = 1 elseif cint(v_page) < 1 then v_page = 1 elseif cint(v_page)>cint(v_totalpage) then v_page=cint(v_totalpage) end if '========================리스트 출력 쿼리문 생성====================== 'MS-SQL sql = "select Top " & pagesize& " " & Query_Fields & " from " & table sql = sql & Query_Where & andOrWhere & " "&idx_field&" not in" sql = sql & "(select top " & pagesize * (v_page - 1) & " "&idx_field&" from " & table sql = sql & Query_Where & Query_OrderBy & ")" sql = sql & Query_OrderBy '========================리스트 출력 쿼리문 생성 끝====================== 'response.write sql Set rs = Dbcon.Execute( sql ) If rs.bof Or rs.eof Then List_data = Null TotalCnt = 0 else List_data = rs.getrows TotalCnt = recordcount End if Set rs = Nothing DbCon.close Set DbCon = Nothing %>