|
|
|
|
±èÁø¿µ / 2000-05-22 / ¿ÀÀü 6:19:34 / 202.30.245.3
Á¶È¸¼ö : 107
|
[Áú¹®] ¿¡·¯¹ß»ýÀ» ÇØ°áÇÏ°í ½Í¾î¿ä< |
<%@ LANGUAGE="VBSCRIPT" %>
<%
Response.Buffer=True
Response.Expires = 0
Response.AddHeader"Pragma","no-cache"
name=Trim(Request("name"))
number=Request("number")
id = session("id")
pc=10
rc=20
setsize = pc
pgsize = rc
if Request.QueryString("page")="" then '³Ñ°Ü¹Þ´Â º¯¼ö´Â ÆäÀÌÁö °ª¸¸
page=1
startpage=1
else
page=cint(Request("page"))
startpage=int(page/setsize)
if startpage=(page/setsize) then
startpage=page-setsize + 1
else
startpage=int(page/setsize)*setsize + 1
end if
end if
Set DbCon = Server.CreateObject("ADODB.Connection")
DbCon.Open "xxx", "xxx", "xxxx"
Set DbRec=Server.CreateObject("ADODB.Recordset")
DbRec.CursorType=1
dim tn,pgcount
sqltc="Select Count(number) as tn From "&name
Set rstc=DbCon.Execute(sqltc)
tn=rstc(0)
rstc.close
set rstc=nothing
pgcount=int(tn/pgsize)
If pgcount*pgsize <> tn Then
pgcount=pgcount+1
End if
listsql="SELECT Top "&pgsize*page&" number,subject,writer,visited,date,substring(content,1,150) as content,size=(datalength(content))+1 FROM " & name& " order by number desc"
DbRec.Open listsql, DbCon
------------------------
¹Ù·ÎÀ§ listsql="SELECT Top "&pgsize*page&" ¶óÀο¡¼ ¹®Á¦°¡ ¹ß»ýÇÕ´Ï´Ù
¹«½¼ ÀÌÀ¯ÀÎÁö ¾ËÁú ¸øÇÏ°Ú½À´Ï´Ù
|
|
|
|