<% 'Option Explicit Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1 %> <% Page = Request ("Page") sTextKind = trim(Request ("sTextKind")) sText = trim(Request ("sText")) sFileN = "/jongha/qna_list.asp" sFileName = sFileN & "?sText=" & sText & "&sTextKind=" & sTextKind & "&" PageSize = 10 PageRange = 10 if Len (Page) = 0 then Page = 1 end if Set adoRs = Server.CreateObject("ADODB.Recordset") %> 종하
 
 
 
 

<% SQL = "SELECT COUNT(*) AS TOTAL FROM JONGHA_QNA" if len(sTextKind)>0 then SQL = SQL & " where " & sTextKind & " like '%" & sText & "%'" end if adoRs.Open SQL, adoCn, 1 totalcount = adoRs("total") adoRs.close If totalcount=0 then totalcount = "0" totalpage = "1" else totalpage = (int)((totalcount/PageSize)+0.9999) End If intTopCnt=(page-1)*PageSize 'select * from jongha_qna order by parent_pk desc, pk asc SQL = "SELECT top "&PageSize&" * FROM JONGHA_QNA where PK not in(select top "&intTopCnt&" PK from JONGHA_QNA" if len(sTextKind)>0 then SQL = SQL & " where " & sTextKind & " like '%" & sText & "%'" end if SQL=SQL&" order by PARENT_PK desc, PK asc)" if len(sTextKind)>0 then SQL = SQL & " AND " & sTextKind & " like '%" & sText & "%'" end if SQL=SQL&" ORDER BY PARENT_PK desc, PK asc" 'RESPONSE.WRITE SQL adoRs.Open SQL, adoCn, 1 If adoRs.BOF Or adoRs.EOF Then %> <% Else intNum=totalcount-PageSize*(page-1) Do Until adoRs.EOF pk = adoRs("pk") title = adoRs("title") writedate = adoRs("writedate") 'readcnt = adoRs("readcnt") If Len(title)>20 Then title=Left(title, 20)&"..." End If %> <% if intNum>1 then %> <% end if adoRs.movenext intNum = intNum-1 Loop end if adoRs.close set adoRs = nothing %>
등록된 글이 없습니다.
9 실버 위치를 알고싶습니다. 황동준 2007-05-29 103
<% If totalcount > 0 Then Call PageNavigation(totalcount,PageSize,Page,sFileName,PageRange) End if %>