ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[±Ð¾Ç] (¹ê¾Ô±MÃD) ºô¸ô¸Õ¨÷ ¤W½g

[±Ð¾Ç] (¹ê¾Ô±MÃD) ºô¸ô¸Õ¨÷ ¤W½g

¬Û«H¦U¦ìºô¤Í­Ì¹ï©ó¡y»·¶Z±Ð¾Ç¡z³o­Ó¦WµüÀ³¸Ó³£¬O¦Õ¼ô¯à¸Ô¤F§a¡I¡y»·¶Z±Ð¾Ç¡z«ôºô¸ô¬ì§Þªº§Þ³Nªº¤éº¥¦¨¼ô¡A¨Ï±o­ì¥»³B©ó²z½×¬ã¨s¶¥¬qªº¡y»·¶Z±Ð¾Ç¡z³vº¥¦¨¬°¥i¥H¹ê»ÚÀ³¥Îªº§Þ³N¡A¡y»·¶Z±Ð¾Ç¡zÅU¦W«ä¸q´N¬O¾Ç¥Í­Ì¥i¥H¥Ñ®a¤¤¹q¸£©Î¦b¾Ç¥Í±JªÙ¤¤¡A¸g¥Ñºô¸ô³s½u¦Ü¾Ç®Õªº¹q¸£­pºâ¾÷¤¤¤ß¡A¨Ó¶i¦æ¡y±Ð¾Ç¡z¡A§Y¨Ï¬O¦Ñ®v¨­©ó¥x¥_¦Ó¾Ç¥Í»·¦b°ª¶¯¡A³£¨ÌµM¥i¥H³z¹Lºô¸ôªº¡y»·¶Z±Ð¾Ç¡z¶i¦æ±Â½Ò¤Î¾Ç²ß¡A¬Æ¦Ü¥i¥H¦bºô¯¸¤Wú¥æ§@·~©Î¬O¶i¦æ¾Ç²ß¦¨ªGªºµû¶q´úÅç¡C

¡@²{¦b°£¤F¥i¥H¨Ï¥Î¶Ç²Îªº¯È±i¤è¦¡¶i¦æ¾Ç²ß´úÅç¥~¡A¦P®ÉÁÙ¥i¥H§Q¥Î¡yºô¸ô¸Õ¨÷¡zªº¤è¦¡©óºô¯¸¤W¶i¦æ²{³õªº¾Ç²ß¦¨ªG´úÅç¡A¤£¦ý¥i¥H°¨¤W±oª¾´úÅ禨ÁZªºµ²ªG§K°£¨¯³Ò¸Õ¨÷§å§ï¡A¦P®ÉÁÙ§K¥Î¯È±i¡A¬°¦a²yÀô«OºÉ¤@¥÷´ÖÁ¡¤§§QËç¡C

¡@¥»±Ð¾Ç½g´N¬O­n¬°¦U¦ìºô¤Í¥Ü½d¤@­Ó¥i¥HÅý©óºô¤W¶i¦æ¾Ç²ß¦¨ªG´úÅ窺¡yºô¸ô¸Õ¨÷¡z(½u¤W¦Ò¸Õ)¡I


¦b¥»½d¨Ò¡yºô¸ô¸Õ¨÷¡z¤¤©Ò¨Ï¥Îªº¸ê®Æ(¾Ç¥Í¸ê®Æ¡A¦ÒÃDµª®×¡B¦¨ÁZµ²ªGµ¥¤T¶µ¸ê®Æ¬ö¿ý)³£¬OÀx¦s©ó¸ê®Æ®wÀɮפ¤¡A§Oºò±i¡I§Ú­Ì©Ò¨Ï¥Îªº¸ê®Æ®wÀɮ׮榡¬° Access §Î¦¡ªº .mdb ÀɮסA¬Û«H¦U¦ìºô¤Í­Ì³£¤w¸g¬O¾r»´´N¼ô°Õ¡I¤£¼ô¡H¨SÃö«Y¡I§Ú­Ì·|¬°¦U¦ì²³æªº¤¶²Ð¦p¦ó«Ø¥ß³o­Ó¸ê®Æ®wÀɮסC
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¸Õ¨÷ªº²Õ¦¨ºc³y
­nÅý¾Ç¥Í¦b½u¤W¶i¦æ¾Ç²ß¦¨ªG´ú¸Õ¡A²Ä¤@¥ó­n§@ªº¨Æ¡A´N¬O¥ý½T»{¾Ç¥Íªº¨­¤À¡A©Ò¥H§Ú­Ì­n¥ý³]­p¤@­Ó¡y¸Õ³õ¤jªù¡zªººô­¶¡A¦b¥»¨Ò¤¤§Ú­Ì±N³o­Óºô­¶ÀɮצWºÙ©w¬°¡G¡yindoor.asp¡z¡A³o­Óºô­¶¥D­n¥Î¨Ó¤ñ¹ï¾Ç¥Íªº¨­¤À¡A¥H«K©ó´ú¸Õµ²§ô«á¡A±N¦Ò¸Õªºµ²ªGÀx¦s©ó¬Û¹ïÀ³ªº¾Ç¥Í¦¨ÁZÄæ¦ì¡C

¦³¤F¡y¸Õ³õ¤jªù¡zªººô­¶¡A¤ñ¹ï¾Ç¥Íªº¨­¤ÀµL»~«á¡A±µ¤U¨Ó§Ú­Ì´N­nµoµ¹¾Ç¥Í¦Ò¸Õ¨÷¡A³o­Ó¦Ò¸Õ¨÷·íµM¬O¥Hºô­¶ªº«¬¦¡§e²{©ó¾Ç¥Íªº¹q¸£¿Ã¹õ¤¤¡A³o¤@­Ó¡yºô¸ô¸Õ¨÷¡zªººô­¶¡A¦b¥»¨Ò¤¤§Ú­Ì±N³o­Óºô­¶ÀɮצWºÙ©w¬°¡G¡yquestion.asp¡z¡A³o­Óºô­¶¤¤±N§t¦³¤@­ÓŪ¨ú¦Ò¸Õ¸ÕÃDªºASPµ{¦¡¨ÓŪ¨ú¸ê®Æ®w¤¤ªº¦ÒÃD¡C

·í¾Ç¥Í§¹¦¨¸ÕÃDªº¶ñ¼g§¹¦¨«á¨Ã¥B«ö¤U¡y¥æ¨÷¡zªº«ö¶s«á¡A±N·|¶i¤Jµû¤ÀªºASPµ{¦¡ºô­¶¤¤¡A¦b³o­Óºô­¶¤¤ASPµ{¦¡±N¶i¦æ¤À¼Æªº­pºâ¡A¨Ã¥B±Nµû¤À«áªº¦¨ÁZ°e¦Ü¸ê®Æ®wÀɮפ¤Àx¦s¡A¤£¶È¦p¦¹¡AASPµ{¦¡ÁÙ·|°¨¤W±Nµû©wªº¦¨ÁZµ²ªG¥ß§YÅã¥Ü¦bºô­¶¤¤¡A¾Ç¥Í¥i¥H¦b½u¤W¶ñ¨÷´úÅç«á°¨¤W±oª¾¦Û¤vªº´úÅ禨ÁZ¡A³o¤@­Ó¡yµû¤À¤Î¤½§G¦¨ÁZ¡zªººô­¶¡A¦b¥»¨Ò¤¤§Ú­Ì±N³o­Óºô­¶ÀɮצWºÙ©w¬°¡G¡ygrad.asp¡z¡C

³Ì«á¡AÁÙ¦³¤@­Ó¥²­nªºÀÉ®×¥²¶·³Q«Ø¥ß¡A¨º´N¬O§t¦³¾Ç¥Í¸ê®Æ¡A¦ÒÃDµª®×¡B¦¨ÁZµ²ªGµ¥¤T¶µ¸ê®Æ°O¿ýªº¸ê®Æ®wÀɮסA³o­Ó¸ê®Æ®wÀɮ׬° Access ®æ¦¡ªº¡@mdb ¸ê®Æ®wÀɮסA­t³d¦s©ñ¾Ç¥Í¸ê®Æ¡A¦ÒÃDµª®×¡B¦¨ÁZµ²ªGªº¸ê®Æ°O¿ý¡A¦b¥»½d¨Ò¤¤³o­Ó¡yÀx¦s¾Ç¥Í¸ê®Æ¡B¦ÒÃD¡B¦¨ÁZµ²ªG¡zªº¸ê®Æ®wÀɮסA§Ú­Ì±N¥¦©w¦W¬°¡G¡yexam.mdb¡z¡C

²¨¥¤§¡A§Ú­Ìºô¸ô¸Õ¨÷ªººc¦¨¦@¦³¤U¦C¥|¤j³¡¤À¡G

  • ¸Õ³õ¤jªùºô­¶¡G¥Î¨ÓÀËÅç¨ü´ú¾Ç¥Íªº¨­¤À¡C
  • ºô¸ô¸Õ¨÷ºô­¶¡G¤]´N¬O¾Ç¥Í­Ì­n§@µªªº¦Ò¸Õ¨÷¡A¦b³o­Óºô­¶¤¤±NÅã¥Ü¾Ç­Ì­Ì±µ¨ü´úÅ窺©Ò¦³ÃD¥Ø¡C
  • µû¤À¤Î¤½§G¦¨ÁZºô­¶¡G¦b³o­Óºô­¶¤¤ASPµ{¦¡±N¶i¦æ¤À¼Æªº­pºâ¡A±Nµû¤À«áªº¦¨ÁZ°e¦Ü¸ê®Æ®wÀɮפ¤Àx¦s¡A¨Ã¥B±N¨ü´ú¾Ç¥Íªº¦¨ÁZµ²ªG¥ß§YÅã¥Ü¥X¨Ó¡C
  • ¸ê®Æ®wÀɮסG­t³d¦s©ñ¾Ç¥Í¸ê®Æ¡A¦ÒÃDÃD¥Øµª®×¡B¦¨ÁZµ²ªGªº¸ê®Æ°O¿ý¡C


¤U¹Ï¬°ºô¸ô¸Õ¨÷ªº²Õ¦¨»PÃöÁp©Ê»¡©ú¹Ï¡G

9-1.png
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¸Õ³õ¤jªù
§Ú­Ì­nÅý¾Ç¥Í©óºô¸ô½u¤W¶i¦æ¾Ç²ß¦¨ªG´úÅç¡A­º¥ý­n§@ªº¨Æ´N¬O¥ý½T»{«e¨Ó°Ñ¥[´úÅç¦Ò¸Õªº¾Ç¥Í¨­¤À¡A©Ò¥H§Ú­Ì¥²¶·¥ý³]­p¤@­Ó¥i¥HÅçÃҾǥͨ­¤Àªº¡yºô¸ô¸Õ¨÷¡Ð¸Õ³õ¤jªù¡zºô­¶¡A½T»{­n°Ñ¥[´úÅ窺¾Ç¥Í¬O§_¦b§Ú­Ìªº¨ü´ú¦W³æ¤¤¡A³o­Óºô­¶¤¤§t¦³¤@­Ó¨­¤À½T»{ªººô­¶ªí³æÅý¨ü´ú¾Ç¥Í¶ñ¼g©m¦W»P¾Ç¸¹¡A¨Ã¥B§t¦³¤@¤äASPµ{¦¡»P¥t¤@¤äÀˬdªí³æÄæ¦ì¨ü§_¦³¶ñ¼g¸ê®ÆªºVB Script µ{¦¡¡A¨ü´ú¾Ç¥Í«ö¤Uªí³æ¤¤ªº¡y¶i¤J¦Ò³õ¡z«ö¶s«á¡A±N·|¥ý±Ò°ÊVB Script µ{¦¡ÀËÅç¬O§_¯Ê¶ñ¬ÛÃöªº¸ê®Æ¡A±µµÛ³o¨Ç¸ê®Æ±N·|³Q°e¦ÜASPµ{¦¡¤¤¡AASPµ{¦¡±N·|Ū¨ú¸ê®Æ®w¤¤ªº¨ü´ú¾Ç¥Í¦W³æ¸ê®Æ»P¦Ûºô­¶ªí³æ±µ¦¬¨ìªº¾Ç¥Í¸ê®Æ¤ñ¹ï¥H½T»{«e¨Ó¨ü´ú¾Ç¥Íªº¸ê®æ¡A¦pªG½T»{¨ü´ú¾Ç¥Íªº¨­¤ÀµL»~«á´N·|¶i¤J¡yºô¸ô¸Õ¨÷¡Ð¸Õ¨÷ºô­¶¡z¡C

¡@²{¦b§Ú­Ì´N¨Ó»s§@³o­Ó§t¦³¿é¤J¸ê®ÆÀˬd¡B¨­¤ÀÅçÃÒÀˬdªº¸Õ³õ¤jªùºô­¶¡yindoor.asp¡z¡G

9-2.png

½s¸¹

Äæ¦ì

Äæ¦ì¦WºÙ

ªí³æ¤¸¥ó

¢Ï

©m¦W

studentname

³æ¦æ¤å¦r¿é¤J¤è¶ô

¢Ð

¾Ç¸¹

number

³æ¦æ¤å¦r¿é¤J¤è¶ô


«ö¤Uªí³æ¤¤ªº¡y¶i¤J¦Ò³õ¡z«ö¶s<input type="button" value="¶i¤J¦Ò³õ" onclick="datacheck">«á¡A±N·|¥ý±Ò°ÊVB Script µ{¦¡¤¤ªºÀËÅç¨ç¼Æ¡ydatacheck¡zÀËÅç¬O§_¯Ê¶ñ¬ÛÃöªº¸ê®Æ¡AµM«áIJµoºô­¶¤¤ªºASPµ{¦¡¶i¦æ¨­¤ÀÅçÃÒ¡C

Àˬd¸ê®ÆÄæ¦ì¬O§_¶ñ¼g¸ê®ÆªºVB script µ{¦¡¡G
  1. <script language="vbscript">
  2. <!--
  3. <!-- Àˬd¦³¨S¦³¿é¤J¸ê®Æ -->
  4. Function datacheck

  5. <!--§Q¥ÎVB ÀËÅç¦r¦êªø«×ªºLen¨ç¼ÆÅçÃÒÄæ¦ì¸ê®Æ¬O§_¶ñ¼g-->
  6. IF Len(document.indoor.studentname.value)=0 or Len(document.indoor.number.value)=0 then
  7. <!--¦pªG¦³Äæ¦ì¨S¦³¶ñ¼g«h¨q¥Xĵ§iµøµ¡-->
  8. msg="½Ð¿é¤J¸ê®Æ¡I"
  9. MsgBox msg,vbExclamation,"¿ù»~!"
  10. Exit Function
  11. End IF
  12. <!--¦pªGÄæ¦ì¸ê®Æ³£¦³¶ñ¼g«hIJµo¨­¤ÀÅçÃÒªºASPµ{¦¡-->
  13. indoor.Submit
  14. End Function
  15. -->
  16. </script>
½Æ»s¥N½X
¦b³o­ÓÀËÅç¸ê®ÆÄæ¦ì¬O§_¦³¶ñ¼g¸ê®ÆªºVB Scriptµ{¦¡¤¤¡A§Ú­Ì§Q¥ÎVB ÀËÅç¦r¦êªø«×ªºLen¨ç¼ÆÅçÃÒÄæ¦ì¸ê®Æ¬O§_¶ñ¼g¡A¦pªG¦³¥ô¤@­ÓÄæ¦ì¨S¦³¶ñ¨Ç¸ê®Æ±N·|¥X²{¤U¹ÏªºÄµ§iµøµ¡¡G

9-3.png
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¨­¤ÀÅçÃÒ

ÁöµM»¡§Ú­Ì¦b¸ê®ÆÄæ¦ì¤¤¶ñ¼g¤F©m¦W»P¾Ç¸¹¸ê®Æ¡A¦ý¬Oµ{¦¡ÁÙ¬O·|¦A®Ö¹ï¤@¦¸¨­¤ÀËç¡I¦pªG«e¨Ó¨ü´ú¾Ç¥Í¨Ã¨S¦³¦b¸ê®Æ®wªº¨ü´ú¾Ç¥Í¦W³æ¸ê®Æ¤¤¡A¨º»ò´N·|¥X²{´£¥Ü°T®§¡A´£¿ô«e¨Óªº¨ü´úªº¾Ç¥Í¬O§_¦³»~¶ñ¸ê®Æ¡A¨Ã­n¨D­«·s¶ñ¼g¸ê®Æ¡C

9-3A.png

indoor.asp
  1. <%
  2. '©Ó±µ¥ÑIndoorªí³æ¶Ç¨Óªº¾Ç¸¹¡B©m¦W¸ê®Æ
  3. studentname=Request("studentname")
  4. number=Request("number")
  5. Msg=""
  6. '¦pªGIndoorªí³æ¶Ç¨Óªº¾Ç¸¹¡B©m¦W¸ê®Æ¤£¬OªÅ¥Õªº
  7. '´N¶i¦æ»P¸ê®Æ®w¤¤¨ü´ú¾Ç¥Í¸ê®Æ¶i¦æ¤ñ¹ï
  8. IF studentname<>Empty and number<>Empty then
  9. '¶}±Òexam.mdb¸ê®Æ®w
  10. '«Ø¥ß¸ê®Æ®w³sµ²ª«¥óconobject
  11.    Set conobject = Server.CreateObject("ADODB.Connection")
  12. '§Q¥ÎMapPath¤èªk¨ú±o¸ê®Æ§¹¾ã¯u¹ê¸ô®|   
  13.    DBPath = Server.MapPath("exam.mdb")
  14. '§Q¥ÎOpen¤èªk¥´¶}¸ê®Æ®w   
  15.    conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
  16. '«Ø¥ß¦s¨ú¸ê®Æ®wª«¥órecobject   
  17.    Set recobject=Server.CreateObject("ADODB.Recordset")
  18. '±qstudent¸ê®Æªí¤¤§ä¥X¾Ç¸¹¡B©m¦W»P¿é¤J¬Û¦Pªº¸ê®Æ
  19.    SQL="SELECT * From student where ¾Ç¸¹="&number&" and ©m¦W='"&studentname&"'"
  20.    recobject.Open SQL,conobject,1,1,1
  21. '¦pªG©m¦W¾Ç¸¹ÅçÃÒµL»~´N¶i¤J¸Õ¨÷ºô­¶
  22.    Do while not recobject.EOF
  23.       Response.Redirect "question.asp?"&Request.QueryString
  24.       recobject.MoveNext
  25.    Loop
  26. '¦pªG§ä¤£¨ì¹ïÀ³ªº¾Ç¸¹»P©m¦W´NÅã¥Ü¿ù»~°T®§
  27.    IF Msg="" then
  28.    Msg="©m¦W©Î¾Ç¸¹¿é¤J¦³¿ù»~¡I"
  29.    End IF
  30. 'Ãö³¬¸ê®Æ®w
  31.    recobject.Close
  32.    conobject.CLose
  33. End If
  34. %>

  35. <html>
  36. <head>
  37. <title>ºô¸ô¸Õ¨÷-¸Õ³õ¤jªù</title>
  38. <script language="vbscript">
  39. <!--
  40. <!-- Àˬd¦³¨S¦³¿é¤J¸ê®Æ -->
  41. Function datacheck
  42. <!--§Q¥ÎVB ÀËÅç¦r¦êªø«×ªºLen¨ç¼ÆÅçÃÒÄæ¦ì¸ê®Æ¬O§_¶ñ¼g-->
  43. IF Len(document.indoor.studentname.value)=0 or Len(document.indoor.number.value)=0 then
  44. <!--¦pªG¦³Äæ¦ì¨S¦³¶ñ¼g«h¨q¥Xĵ§iµøµ¡-->
  45. msg="½Ð¿é¤J¸ê®Æ¡I"
  46. MsgBox msg,vbExclamation,"¿ù»~!"
  47. Exit Function
  48. End IF
  49. <!--¦pªGÄæ¦ì¸ê®Æ³£¦³¶ñ¼g«hIJµo¨­¤ÀÅçÃÒªºASPµ{¦¡-->
  50. indoor.Submit
  51. End Function
  52. -->
  53. </script>
  54. </head>
  55. <body>
  56. <!-- ¿é¤J¸ê®Æªºªí³æ -->
  57. <p align="center"><font color="#FF0000" size="6" face="·s²Ó©úÅé">ºô¸ô¸Õ¨÷-¸Õ³õ¤jªù</font></p>
  58. <!--¨ü´ú¾Ç¥Í©Ò¶ñªº¸ê®Æ¤£¥¿½T±N·|¥X²{¤@¬q¿ù»~°T®§-->
  59. <center><font color="red"><%=Msg%></font></center>
  60. <form method="get" name="indoor" >
  61.   <div align="center">
  62.     <table border="0" width="60%">
  63.       <tr>
  64.         <td width="50%">
  65.           <p align="right"><font color="#0000FF">©m¦W¡G</font></td>
  66.         <center>
  67.         <td width="50%"><input type="text" name="studentname" size="10" value="<%=studentname%>"></td>
  68.         </tr>
  69.       <tr>
  70.         <td width="50%">
  71.           <p align="right"><font color="#0000FF">¾Ç¸¹¡G</font></td>
  72.         <td width="50%"><input type="number" name="number" size="10" value="<%=number%>"></td>
  73.         </tr>
  74.         <tr>
  75.           <td width="100%" colspan="2">
  76.             <p align="center"><input type="button" value="¶i¤J¦Ò³õ" onclick="datacheck">
  77.             <input type="reset" value="­«·s¿é¤J"></td>
  78.         </tr>
  79.       </table>
  80.     </center>
  81.   </div>
  82. </form>
  83. </body>
  84. </html>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¸Õ¨÷µ{¦¡ºô­¶
¦b¡yºô¸ô¸Õ¨÷¡Ð¸Õ³õ¤jªù¡zºô­¶¤¤¡A§Q¥ÎVB Script µ{¦¡Àˬdªí³æÄæ¦ì¸ê®Æªº¶ñ¼g»PASPµ{¦¡½T»{¨ü´ú¾Ç¥Íªº¨­¤ÀµL»~«á´N·|¶i¤J¡yºô¸ô¸Õ¨÷¡Ð¸Õ¨÷ºô­¶¡z¨Ó¶i¦æ´úÅç¡A¦b¡yºô¸ô¸Õ¨÷¡Ð¸Õ¨÷ºô­¶¡zªºASPµ{¦¡¾÷¨î¤¤¤À¬°¨â¤j³¡¤À¡A¤@¬°«Ø¥ß«Ø¥ß¸ê®Æ®w³sµ²ª«¥ó(Connection)¡B«Ø¥ß¦s¨ú¸ê®Æ®wª«¥ó(Recordset)¨Ó»P¸ê®Æ®w¶i¦æ³sµ²»P¦s¨ú¸ê®Æ¤º¸ê®Æªíªº¸ê®Æ¡A¥t¤@¬°±NŪ¨ú¶i¨Óªº¡y¦Ò¸ÕÃD¥Ø¡zÅã¥Ü¦bºô­¶¤¤Åý¨ü´ú¾Ç¥Í§@µª¡C

³sµ²¶}±Ò¸ê®Æ®w

¡@­º¥ý§Ú­Ì¥ý¨Ó¬Ý¬Ý¸ê®Æ®w¶i¦æ³sµ²»P¦s¨ú¸ê®Æ®w¤º¸ê®Æªíªº¸ê®ÆªºASPµ{¦¡¬O¦p¦ó«Ø¥ß¤Î¶}±Ò¤@­Ó¸ê®Æ®wÀɮסG
  1. <%
  2. '©Ó±µ¨Ó¦ÛIndoor.aspªº¾Ç¸¹¡B©m¦W¸ê®Æ
  3. studentname=Request("studentname")
  4. number=Request("number")
  5. '¶}±Òexam.mdb¸ê®Æ®w¤¤ªºfirst(ÃD¥Ø)¸ê®Æªí
  6. '«Ø¥ß¸ê®Æ®w³sµ²ª«¥óconobject
  7. Set conobject = Server.CreateObject("ADODB.Connection")
  8. '§Q¥ÎMapPath¤èªk¨ú±o¸ê®Æ§¹¾ã¯u¹ê¸ô®|
  9. DBPath = Server.MapPath("exam.mdb")
  10. '§Q¥ÎOpen¤èªk¥´¶}¸ê®Æ®w
  11. conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
  12. '«Ø¥ß¦s¨ú¸ê®Æ®wª«¥órecobject
  13. Set recobject=Server.CreateObject("ADODB.Recordset")
  14. SQL="SELECT * From "&"first"&" ORDER by ÃD¸¹"
  15. recobject.Open SQL,conobject,1,1,1
  16. '¥ý±N¸ê®Æªíªº¸ê®Æ¿ý²¾¦Ü²Ä¤@µ§
  17. recobject.MoveFirst
  18. %>
½Æ»s¥N½X
¦bASPµ{¦¡¤¤¡A§Ú­Ì­Y­n¶i¦æ¸ê®Æ®wªº¦s¨ú°Ê§@¥²¶·¥ý«Ø¥ß¤@­Ó Connectionªºª«¥ó(¸ê®Æ®w³sµ²ª«¥ó)¡AConnection ª«¥ó¬O­t³d»P¸ê®Æ®w¹ê»Úªº³sµ²°Ê§@¡A«Ø¥ß»Pºô¸ô¦øªA¾¹¸ê®Æ®wªº³sµ²¬O¶i¦æ¸ê®Æ®w¦s¨úªº²Ä¤@¨B¡A­Y¨S¦³ Connection ª«¥ó³sµ²¸ê®Æ®w¡A«hªÅ¦³¨ä¥Lª«¥ó¤]¨S¥Î¡A±µµÛ§Ú­Ì¦A§Q¥Î¨Ï¥Î Connection ª«¥óªº¡yOpen¡z¤èªk¨Ó³sµ²¡ymdb¡z¸ê®Æ®w¡A¦pªG§Ú­Ì­n³sµ²ªºmdb¸ê®Æ®w¦³³]©w±K½X¡A¨º»ò§Ú­Ì´N­n¨Ï¥Î³o­Ó±K½X°Ñ¼Æ¡A­Y¸ê®Æ®w¨S¦³³]©w±K½X¡A¨º»ò§Ú­Ì´N¥i¥H¬Ù¦C³o­Ó°Ñ¼Æ:

¡@¤Uªí¬°§Q¥ÎConnection ª«¥óªº¡yOpen¡z¤èªk¨Ó³sµ²¡ymdb¡z¸ê®Æ®w¥²¶·µ¹¤©ªº°Ñ¼Æ

°Ñ¼Æ

³]©w­È

Provider

microsoft.jet.oledb.4.0

Data Source

¹ê»Ú¸ô®|ÀɮצWºÙ

jet oledb:database password

±K½X



§Q¥ÎConnectionªºª«¥ó³sµ²¸ê®Æ®w«á¡A§Ú­Ì¥²¶·¦A«Ø¥ß¤@­ÓRecordSetª«¥ó¥X¨Ó¡ARecordsetª«¥ó¬O­t³dÂsÄý»P¾Þ§@±q¸ê®Æ®w¨ú¥X¨Óªº¸ê®Æ¡ARecordsetª«¥ó¨ä¹ê¬O°w¹ï¸ê®Æ®w¤¤ªº¸ê®Æªí¶i¦æ¦s¨úªº°Ê§@¡A¥i¥H·f°t¤U¤èÄÝ©ÊMoveFirst¤ÎEOF±N©Ò¦³¸ê®ÆŪ¨ú

§ïÅܥثe¸ê®Æªíªº¤èªk

  • MoveNext¡G²¾¦Ü¤U¤@µ§¸ê®Æ¨Ï¨ä¦¨¬°²{¥Î¸ê®Æ¿ý
  • MovePrevious¡G²¾¦Ü«e¤@µ§¸ê®Æ¨Ï¨ä¦¨¬°²{¥Î¸ê®Æ¿ý
  • MoveFirst¡G²¾¦Ü²Ä¤@µ§¸ê®Æ¨Ï¨ä¦¨¬°²{¥Î¸ê®Æ¿ý
  • MoveLast¡G²¾¦Ü³Ì«á¤@µ§¸ê®Æ¨Ï¨ä¦¨¬°²{¥Î¸ê®Æ¿ý
  • BOF¡G¸ê®Æ¿ý«ü¼Ð¬O§_²¾¦Ü²Ä¤@µ§¸ê®Æ¿ý¤§«e
  • EOF¡G¸ê®Æ¿ý«ü¼Ð¬O§_²¾¦Ü³Ì«á¤@µ§¸ê®Æ¿ý¤§«á
  • AbsolutePosition¡G³]©w©Î¶Ç¦^²{¥Î¸ê®Æ¿ýªºµ´¹ï¦ì¸m



¸ê®Æªíªº·s¼W¡B§R°£»P­×§ï

  • Addnew¡G·s¼W¸ê®Æ¿ý
  • Update¡G§ó·s¸ê®Æ¿ý
  • CancelUpdate¡G¨ú®ø§ó·s¸ê®Æ
  • Delete¡G§R°£¸ê®Æ¿ý
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD