|
|
|
|
À²¸® / 2000-08-09 / ¿ÀÈÄ 4:18:41 / 211.195.39.84
Á¶È¸¼ö : 119
|
[Áú¹®] ´Ù½Ã Á» ºÁÁÖ¼¼¿ä.... |
À½.. Áö±Ý º¸¿©ÁֽŠfor ¹®¿¡¼ ¾à°£ÀÇ ¿À·ù°¡ ÀÖ´Â
µí ½Í³×¿ä..
for ¹®À» ±×´ë·Î Çؼ®ÇÏÀÚ¸é,
"i °ªÀ» 1ºÎÅÍ ½ÃÀÛÇؼ DbRec.EOF ±îÁö µÇµµ·Ï for
¹®À» ½ÇÇàÇضó" Àε¥..
¾à°£ Á» ÀÌ»óÇÏÁÒ? ^^
·¹Äڵ尪À» Àбâ À§ÇÑ for ¹®ÀÇ Á¶°Ç½ÄÀ¸·Î´Â Á» ºÎÀû´çÇÕ´Ï´Ù.
EOF ¶ó´Â °ªÀ» ¼ýÀÚ°ªÀÌ ¾Æ´Ñ ºÒ¸°(boolean:true/false) °ªÀ̱⠶§¹®ÀÌÁÒ..
±×·¡¼ °á°ú°ªÀÌ Ãâ·ÂÀÌ ¾ÊµÇ¾ú´ø °Ì´Ï´Ù..
·¹ÄÚµåÀÇ °ªÀ» Ãâ·ÂÇϽǶ§´Â do while ... loop ¹®ÀÌ Àû´çÇÒ µí ½Í³×¿ä..
(¹°·Ð, for ¹®À» ÀÌ¿ëÇؼµµ °¡´ÉÇÕ´Ï´Ù.
俵´Ô °Ô½ÃÆÇ ¼Ò½º¸¦ Á¦°¡ º»ÀûÀÌ ¾ø¾î¼ ¸ð¸£°ÚÁö¸¸, º°¾ÆÇØ´ÔÀÇ °Ô½ÃÆÇÀÌ ÀÌ ¹æ½ÄÀ¸·Î °Ô½Ã¹°À» Ãâ·ÂÇÏ°í ÀÖÁÒ..)
do while not dbrec.eof
num=DbRec(0)
response.write(num)
DbRec.MoveNext
loop
ÀÌ·± Çü½ÄÀ¸·Î ÀÌ¿ëÇÏ½Ã¸é ±¦ÂúÀ» µí...
> > loop µ¹¸®½Ç¶§..
> > dbrec.movenext ÇØÁּ˴ÂÁö¿ä.. ´ÙÀ½·¹ÄÚµå·Î...
>
> À§¿¡¼ ¸»¾¸ÇϽŠ·çÇÁ¹®¿¡¼ÀÇ DbRec.MoveNext´Â ÀÌ¹Ì ³Ö¾î ÀÖ¾ú±¸¿ä....±×¿Í °ü·ÃÇؼ Áú¹®À» ÇÏ·Á±¸ ÇÕ´Ï´Ù...ÀÌ·¡ Àú·¡ ÇÏ´Ùº¸´Ï...¾Æ·¡Ã³·³ for¹® ¾È¿¡ º¯¼öÁöÁ¤À» ÇÏ¿© ·¹Äڵ带 ½áÁÖ¾î¾ß µÇ´Â °Å °°¾Æ¼ Çغôµ¥ ¾Ï°ÍµÎ ¾È³ª¿À³×¿ä..±×·¯´Ï±î ±×Àü¿¡´Â numÀ» for¹® ¹Û¿¡¼ ÁöÁ¤ÇÏ¿´¾ú°Åµç¿ä...±×·¡µÎ ±×¶© ¸Ç óÀ½ ·¹ÄÚµå¶óµÎ ³ª¿Ô¾ú´Âµ¥...±×·±µ¥....
>
> listsql="SELECT num FROM "&tb&" Where "&sqlList&" and ref= "&nref&" ORDER BY num ASC"
>
> DbRec.Open listsql,DbCon
>
> For i=1 to DbRec.EOF
>
> num=DbRec(0)
> response.write(num)
>
> DbRec.MoveNext
>
> next
>
> DbRec.Close
>
> ±×¸®°í...Á¤ÀÛ ÇÊ¿äÇÑ °Ç À§Ã³·³ ÇϳªÀÇ º¯¼ö¿¡ °á°ú°ªÀ» ´ã¾Æ ...À̸¦ ¹Û¿¡¼ ¾µ¼ö ÀÖ´Â ¹æ¹ýÀÌ ¾ø´ÂÁö...À§ °æ¿ì°¡ µÈ´Ù±¸ ÇÏ´õ¶óµÎ for¹® ¾È¿¡¼ numº¯¼öÀÇ ÁöÁ¤ºÎÅÍ »ç¿ë±îÁö ´Ù ÇØ¾ß ÇÏ´Â °á°ú°¡ ºú¾îÁöÀݾƿä..
>
> Àú´Â num¿¡ ¾ò°íÀÚÇÏ´Â ¿©·¯°³ÀÇ ÀÎÀÚ¸¦ ´ã¾Ò´Ù°¡ ¹Ø¿¡¼ ³ªÁß¿¡ ´Ù¸¥ ÆÄÀÏÀÇ ¸µÅ©ºÎºÐ¿¡¼ ÀÎÀÚ·Î ³Ñ°ÜÁÖ·Á±¸ Çϴµ¥...¾îÂî ÇØ¾ß µÇ´ÂÁö....¾î°ÅÁö·Î¶óµµ for¹®¾È¿¡¼ numÀÇ »ç¿ë±îÁö ÇÏ¿©¾ß¸¸ ÇÏ´Â ¹æ¹ý¹Û¿¡ ¾ø´ÂÁö ¾Ë°í ½Í¾î¿ä..
>
>
> Áö±Ý º¸´Ï ¾î°ÅÁö·Î Èûµé°Í °°¾Æ¿ä...¹Ù·Î¹Ø¿¡¼ ·¹ÄÚµå¼ÂÀ» ¶Ç ¿¾î°¡Áö±¸ ·çÇÁ¸¦ µ¹¸®¸é¼ ´ÙÀ½ÆÄÀÏ·Î ¸µÅ©±îÁö ÇÏ°í Àְŵç¿ä...±×·¡¼ À§¿¡¼ Close·Î ´Ý¾ÆÁÖ°í Çß´ø°Çµ¥....¼¿·ºÆ®ÀÇ Á¶°ÇµÎ ´Ù¸£±¸Çؼ °°ÀÌ ¾µ¼öµÎ ¾ø±¸...±×·¡µÎ µÑ´Ù ·çÇÁ¸¦ µ¹·Á¼ ´ÙÀ½ÆÄÀÏÀÇ ÀÎÀÚ·Î µé¾î°¡¾ß Çϰŵç¿ä..
>
>
>
-----------------------------------------------------------
|
|
|
|