<% function writePageMenu(index) if index>=1 then if index=current_page then response.write " "&index&" " else response.write " "&index&" " end if end if end function dim current_page Set conn=Server.CreateObject("ADODB.Connection") conn.open "Driver=microsoft Access Driver (*.mdb);DBQ="&Server.MapPath("./db/hc_db.mdb") Set rs=Server.CreateObject("ADODB.Recordset") sql="select * from news order by date desc" rs.open sql,conn,1 rs.PageSize = 10 current_page = CLng(Request("page")) total_page = rs.PageCount if current_page="" then current_page=1 elseif current_page>total_page then current_page=total_page elseif current_page<1 then current_page=1 end if If Not rs.eof then rs.AbsolutePage=current_page end if total_page = rs.PageCount %> HONG LOONG MACHINERY MFG., CO., LTD.
contact
 

 
<% if total_page>1 then response.write "" if current_page<=3 then for i=1 to 10 if i>total_page then exit for end if writePageMenu i Next elseif current_page>=total_page-7 then for i=total_page-10 to total_page if i>total_page then exit for end if writePageMenu i Next else for i=current_page-2 to current_page+7 if i>total_page then exit for end if writePageMenu i Next end if response.write "" end if %>
 |< <  > >| 
<% if total_page>1 then response.write current_page&"/"&total_page end if %>
<% for i=1 to rs.PageSize if rs.EOF then Exit for end if topic = Mid(rs("topic"), 1, 42) if Len(rs("topic"))> 42 then topic = topic&"¡K" end if if i mod 2 = 1 then response.write "
"&rs("date")&""&topic&"
" else response.write "
"&rs("date")&""&topic&"
" end if if i<>rs.RecordCount then response.write "
" end if rs.MoveNext Next %>
<% if total_page>1 then response.write "" if current_page<=3 then for i=1 to 10 if i>total_page then exit for end if writePageMenu i Next elseif current_page>=total_page-7 then for i=total_page-10 to total_page if i>total_page then exit for end if writePageMenu i Next else for i=current_page-2 to current_page+7 if i>total_page then exit for end if writePageMenu i Next end if response.write "" end if %>
 |< <  > >| 
<% if total_page>1 then response.write current_page&"/"&total_page end if %>