|
|
|
|
²ÀÁö / 2001-08-07 / ¿ÀÀü 9:04:18 / 168.126.91.65
Á¶È¸¼ö : 124
|
[Áú¹®] -1 -2 -3À¸·Î ½ÃÀÛµÇ¿ä µµ¿ÍÁÖ¼¼¿ä..... |
> ¹«´õ¿î ¿©¸§³¯ÀÔ´Ï´Ù.
> write.asp¿¡¼ µ¥ÀÌÅ͸¦ ³¯¸®¸é list.asp¿¡¼
> ¹øÈ£ ÀÛ¼ºÀÏ Á¦¸ñ.....¶õ¿¡¼ ¹øÈ£°¡ -1 -2 -3À¸·Î
> ¿ªÀ¸·Î Áõ°¡µÇ´Â±º¿ä...
> °í¼ö´Ôµé ÁöÀû Á» ºÎŹÇÕ´Ï´Ù.
> ¾ÆÁ÷ Ãʺ¸¶ó¼ Å«ÀÏÀÔ´Ï´Ù.
>
>
>
> ------- ÀÌ ºÎºÐÀÔ´Ï´Ù.[list.asp]--------
> <tr bgcolor="#FFFFFF" bordercolor="#9999CC">
> <td width="50" align="center" class="LstTitle" height="20"><% =(count-(intPage-1)*rs.PageSize-i)%></td>
> <td width="80" align="center" class="LstTitle" height="20"><%=Left(rs("writeday"),10)%></td>
> <td width="300" align="left" class="LstTitle" height="20"><%=imgSymbol%><a href="content.asp?id=<%=rs("ID")%>&page=<%=request("PAGE")%>"><%=rs("title")%></a></td>
> <td width="100" align="center" class="LstTitle" height="20"><%=rs("name")%></td>
> <td width="58" align="center" class="LstTitle" height="20"><%=rs("readnum")%></td>
> </tr>
>
-----------------------------------------------------------
¿ì¼± Á¤È®ÇÑ ÇØ´äÀ» ã±â À§Çؼ´Â RecordSetÀ» »ý¼º½ÃÅ°´Â ºÎºÐÀÇ ÄÚµå¿Í ·çÇÎÀ» µ¹¸®´Â ºÎºÐÀÇ Äڵ尡 ÀÖ¾î¾ß µÉ °Í °°½À´Ï´Ù..
Á¦°¡ »ý°¢Çϱâ·Î´Â
(count-(intPage-1)*rs.PageSize-i)
À§ Äڵ忡¼ countÀÇ ÃʱⰪÀÌ -1ÀÌ ÇÒ´ç µÈ °Í °°½À´Ï´Ù.
¸¸¾à -1ÀÇ °ªÀÌ ÇÒ´çµÇ¾î ÀÖ´Ù¸é
RecordSet CursorŸÀÔÀ» È®ÀÎ ÇÏ¿© º¸½Ã±æ ¹Ù¶ø´Ï´Ù.
cursor typeÀÌ 0(adOpenForwardOnly), 2(adOpenDynamic)Àº RecordCount¼Ó¼ºÀÌ Áö¿øµÇÁö ¾Ê½À´Ï´Ù.
strQuery="select ~~~"
¸¸¾à RecordSet OpenÀ»
1) objRs.Open strQuery, objCon, 0
¶Ç´Â
2)objRs.Open strQuery, objCon, 2
(ÀÌ°æ¿ì´Â ¾Æ´Ò°Í °°À½)
¶Ç´Â
3) Set objRs = objCon.Execute(strQeury)
(Connection°´Ã¼¸¦ ÀÌ¿ëÇÑ ·¹ÄÚµå¼Â »ý¼º)
À§¿Í °°ÀÌ ·¹ÄÚµå¼ÂÀ» »ý¼º.¿ÀÇ ½ÃÅ°°í ³µÚ
count = objRs.RecordCount
°°ÀÌ ÄÚµùÀ» ÇÏ¿´´Ù¸é
count º¯¼ö¿¡ ÇÒ´çµÈ °ªÀº -1 ÀÌ µË´Ï´Ù.
¾Õ¿¡¼¿Í ¸»¾¸µå·ÈµíÀÌ
cursor typeÀÌ 0(adOpenForwardOnly), 2(adOpenDynamic)Àº RecordCount¼Ó¼ºÀÌ Áö¿øµÇÁö ¾Ê±â ¶§¹®¿¡ -1À̶õ °ªÀ» ¹Ýȯ ½ÃÅ°°Ô µË´Ï´Ù.
·¹ÄÚµå¼Â »ý¼ººÎºÐ°ú ·çÇÎ ºÎºÐÀÇ Äڵ尡 ÀÖ¾î¾ß Á¤È®ÇÑ ÇØ´äÀÌ ³ª¿Ã°Í °°½À´Ï´Ù..
2È£¼± ´þ³×¿ä...¤Ì.¤Ì |
|
|
|