¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > Recordset - Attributes

µî·ÏÀÏ : 2017-07-04 17:09 Á¶È¸¼ö : 52,681

Recordset °³Ã¼ÀÇ ¼Ó¼ºµéÀº ¾ÆÁÖ ¸¹½À´Ï´Ù....
¿©±â¿¡¼­ ¸ðµÎ´Ù ¾Ë°í, ¶Ç´Â Á¦°¡ ´Ù ¾ËÁöµµ ¸øÇÒ»Ó ¾Æ´Ï¶ó, ÇÒ¼öµµ ¾ø½À´Ï´Ù.
Á¦°¡ ÀÌÇØÇÏ°í, ¾Ë°í ÀÖ´Â ºÎºÐ±îÁö¸¸ Á¤¸®ÇØ ³Ö¾î µå¸®µµ·Ï ÇÏ°Ú½À´Ï´Ù.
 
  5.12.1 PageSize , pagecount, AbsolutePage,AbsolutePosition ¼Ó¼º
 
 
<!--METADATA TYPE= "typelib"  NAME= "ADODB Type Library"  
			FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll"  -->
	<%
	Set objCnn = Server.CreateObject("ADODB.Connection")
	Set objRs  = Server.CreateObject("ADODB.Recordset")
	objCnn.Open ("Provider=SQLOLEDB;User ID=sa;Password=;Initial Catalog=test;Data Source=MOBBIE-ANKYU")

	strSql="SELECT * FROM BOARD"
   	objRs.PageSize = 10  
   	objRs.Open strSql,objCnn,adOpenKeyset 
   	
	objRs.AbsolutePage=5
	
	do while not objRs.eof
	  response.write objRs.recordcount& "·¹ÄÚµåÁß:"& objRs.absolutePosition &"¹ø°<br>" 
	  objRs.movenext
	loop
	
	response.write objRs.pagecount
	%>



PageSize ¼Ó¼ºÀº Recordset °³Ã¼¿¡¼­ ÆäÀÌÁö Çϳª¸¦ ±¸¼ºÇÏ´Â ·¹ÄÚµå ¼ö¸¦ ³ªÅ¸³À´Ï´Ù.
ÀÌ ¼Ó¼ºÀ» »ç¿ëÇÏ¿© µ¥ÀÌÅÍÀÇ ³í¸®Àû ÆäÀÌÁö Çϳª¿¡ µé¾î ÀÖ´Â ·¹ÄÚµå ¼ö¸¦ °áÁ¤ÇÏ°Ô ÇÕ´Ï´Ù.
ÀÌ ÆäÀÌÁöÀÇ Å©±â¸¦ ¼³Á¤ÇÏ°Ô µÇ¸é Absolutepage¼Ó¼ºÀ» »ç¿ëÇÏ¿© ƯÁ¤ ÆäÀÌÁöÀÇ Ã¹¹ø°
·¹ÄÚµå·Î À̵¿ÇÒ¼ö ÀÖ½À´Ï´Ù.

±×¸®±¸, ÆäÀÌÁöÀÇ Å©±â¸¦ ±¸ÇÏ°í ½ÍÀ¸¸é pagecount¼Ó¼ºÀ» »ç¿ëÇÏ½Ã¸é µÇ±¸¿ä.

ÇöÀçÀÇ ÆäÀÌÁö¸¦ ±¸ÇÏ´Â ¼Ó¼ºÀº absolutePosition ÀÔ´Ï´Ù.

  5.12.2 Bookmark ¼Ó¼º
 
<!--METADATA TYPE= "typelib"  NAME= "ADODB Type Library"  
			FILE="C:\Program Files\Common Files\SYSTEM\ADO\msado15.dll"  -->

	<%
	Set objCnn = Server.CreateObject("ADODB.Connection")
	Set objRs  = Server.CreateObject("ADODB.Recordset")
	objCnn.Open ("Provider=SQLOLEDB;User ID=sa;Password=;Initial Catalog=test;Data Source=MOBBIE-ANKYU")

	strSql="SELECT * FROM BOARD"
   	objRs.CursorType=adOpenStatic
   	objRs.CursorLocation=aduseClient
   	
   	objRs.Open strSql,objCnn, , , adCmdText
	
	objRs.MoveLast
	objRs.MovePrevious
	
	
	response.write "·¹ÄÚµå °ª:"&objRs(1)&" , "
	bookmark=objRs.bookmark
	response.write "ºÏ¸¶Å© °ª:"& bookmark&"<br>"

	objRs.MoveFirst
	response.write "·¹ÄÚµå °ª:"&objRs(1)&" , "
	response.write "ºÏ¸¶Å© °ª:"& bookmark&"<br>"

	objRs.bookmark=bookmark
	response.write "·¹ÄÚµå °ª:"&objRs(1)&" , "
	response.write "ºÏ¸¶Å© °ª:"& bookmark&"<br>"
	%>  



bookmark ¼Ó¼ºÀº Recordset °³Ã¼ÀÇ ·¹Äڵ带 Áß¿¡¼­ ÇöÀçÀÇ ·¹Äڵ带 ½Äº°ÇÏ´Â °ªÀÔ´Ï´Ù.
bookmark °ªÀ» º¯¼ö¿¡ ÀúÀåÇÑÈÄ¿¡ ´Ù¸¥ ·¹ÄÚµå·Î À̵¿ÇÑ ÈÄ Recordset °³Ã¼ÀÇ bookmark ¼Ó¼º¿¡
ÀÌ º¯¼öÀÇ °ªÀ» ÁöÁ¤Çϸé ÇØ´ç ·¹ÄÚµå·Î À§Ä¡¸¦ À̵¿ÇÏ°Ô ÇÕ´Ï´Ù.

À§ÀÇ ¿¹Á¦¸¦ º¸¸é  MoveLast,MovePrevious ¸¦ ÅëÇØ ¸¶Áö¸· ·¹ÄÚµå·Î À̵¿ÇÑ ´ÙÀ½ ¸¶Áö¸· ¹Ù·ÎÀü
·¹ÄÚµå·Î ´Ù½Ã À̵¿½ÃŲÈÄ ·¹ÄÚµå °ª°ú bookmark °ªÀ» Ãâ·ÂÇØ º¸¾Ò½À´Ï´Ù.
±×·±ÈÄ ´Ù½Ã óÀ½ ·¹ÄÚµå·Î À̵¿ ½ÃŲÈÄ Ãâ·ÂÇß½À´Ï´Ù.
±×¸®±¸, bookmark º¯¼öÀÇ °ªÀ» bookmark ¼Ó¼º¿¡ ´ëÀÔÇÑÈÄ ´Ù½Ã Ãâ·Â½ÃÅ°´Ï, ·¹Äڵ尡  ¹Ù·Î À̵¿Çϴ°É
º¼¼ö ÀÖ½À´Ï´Ù.
 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.