+++ ȨÁ¦ÀÛ ¹ÙÀ̺í +++
ȨÁ¦ÀÛ ¹ÙÀ̺í ÀÌ »çÀÌÆ®´Â ÀÌ¿µÂù´ÔÀÇ »çÀÌÆ®¸¦ º¹¿øÇÑ °ÍÀÔ´Ï´Ù.
Untitled Document
Html
Dhtml
Css
Php
Asp
Cgi
Java Script
Java Applet
Multimedia
Win Tip
°Ô½ÃÆǸ¸µé±â (9) - ÆäÀÌ¡
<!--METADATA TYPE="typelib" NAME="ADODB Type Library"
    FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll" -->

<%
Option Explicit

Dim strConnect
strConnect="Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=C:\DataStore\board.mdb"

Dim objConn, objRS, SQL, Rcount
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnect
SQL = "select count(b_key) as recCount from MyBoard"
Set objRS = objConn.Execute(SQL)
Rcount = objRS(0)

Dim Pscale,Psize, Pnum, Pcount
Pscale=10
Psize=10
Pcount = CInt((Rcount-1)/Psize) + 1

Pnum = Request.QueryString("Pnum")
if Pnum = "" then
    Pnum = 1
end if

SQL = "SELECT TOP " & Psize & " * FROM MyBoard "
  if int(Pnum) > 1 then
    SQL = SQL & " WHERE b_key not in "
    SQL = SQL & "(SELECT TOP " & ((Pnum - 1) * Psize) & " b_key FROM MyBoard"
    SQL = SQL & " ORDER BY b_key DESC) "
  end if
SQL = SQL & " order by b_key desc"
Set objRS = objConn.Execute(SQL)


Response.Write "<center>" & _
               "<h1>°Ô½ÃÆÇ</h1>" & Pnum & " " & Pscale & " " & Pcount & " " & Rcount & _
               "<table border=0 width=500>" & _
               "<tr><td align=right><a href=./board.asp?mode=write>±Û¾²±â</a></td></tr>" & _
               "</table>" & _
               "<table border=1 width=500>" & _
               "<tr>" & _
                "<td align=center>¹øÈ£</td>"& _
               "<td align=center>À̸§</td>"& _
               "<td align=center>Á¦¸ñ</td>"& _
               "<td align=center>Á¶È¸¼ö</td>"& _
               "<td align=center>³¯Â¥</td>" & _
               "</tr>"

Dim vDate, vYear, vMonth, vDay, vHour, vMin

Do while Not objRS.EOF

    vDate = objRS("b_date")
    vYear = year(vDate)
    vMonth = right("0" & month(vDate) , 2)
    vDay = right("0" & day(vDate) , 2)
    vHour = right("0" & hour(vDate) , 2)
    vMin = right("0" & minute(vDate) , 2)
    vDate = vYear & "/" & vMonth & "/" & vDay & " (" & vHour & ":" & vMin & ")"

    Response.write "<tr>" & _
               "<td align=center>" & objRS("b_key") & "</td>" & _
               "<td align=center><a href = 'mailto:" & objRS("b_email") & "'>" & _
                objRS("b_name") & "</a></td>" & _
               "<td align=center><a href=./board.asp?mode=pre_read&key=" & _
                objRS("b_key") & ">" & objRS("b_title") & "</a>"

               if datediff ("h",objRS("b_date"),Now()) < 24 then
                   Response.Write "<img src=./img/new.gif border=0>"
               end if
               if objRS("b_acc") > 30 then
                   Response.Write "<img src=./img/hot.gif border=0>"
               end if
    Response.Write "</td><td align=center>" & objRS("b_acc") & "</td>" & _
               "<td align=center>" & vDate & "</td>" & _
               "</tr>"
    objRS.MoveNext
Loop
Response.write "</table>"


Dim Step,StepStart,StepEnd,prenum,nextnum

Response.Write "<table border=0 width=500 cellpadding=3 cellspacing=3>" & _
               "<tr><td align=center>"

if Int(Rcount) > Int(Psize) then

    StepStart = Int((Pnum-1)/Pscale)*Pscale+1
    
    if (Pcount - StepStart) < (Pscale-1) then
        StepEnd = StepStart + Pcount-StepStart
    else
        StepEnd = StepStart+(Pscale-1)
    end if

    if Int(Pscale) < Int(Pnum) then
        prenum = StepStart - Pscale
        Response.Write "[<a href=list.asp?Pnum=" & prenum & ">Pre</a>] - "
    end if

    For Step = StepStart to StepEnd
        if Int(Step) = Int(Pnum) then
            response.write "[" & Step & "]"
        else
            Response.Write "[<a href=list.asp?Pnum=" & Step & ">" & Step & "</a>]"
        end if
    Next

    if Int(Pcount - StepStart) > Int(Pscale-1) then
        nextnum = StepStart+Pscale
        Response.Write " - [<a href=list.asp?Pnum=" & nextnum & ">Next</a>]"
    end if
end if

Response.Write "</td></tr></table></center>"

%>

<br>
<center>
<a href=./board.asp?mode=write>±Û¾²±â<%= StepStart %></a>
</center>
Update : 2001/06/11 [µ¹¾Æ°¡±â]