«á¤@­¶
«e¤@­¶
¦^¥Ø¿ý
¦^­º­¶
²Ä¤Q¤T³¹¡@Delphi¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡·§­z¡]¤@¡^

13.1 ¸ê®Æ®w¨t²Î·§­z¡@

        ¸ê®Æ®w¨t²Î¬°§Ú­Ì´£¨Ñ¤F¤@ºØ§â»P§Ú­Ìªº¤u§@©M¥Í¬¡ºò±K¬ÛÃöªº¸ê°T¶°¦X¦b¤@°_ªº¤èªk¡A¥¦ÁÙ´£¨Ñ¤F¦b¬Y­Ó¶°¤¤ªº¦a¤è¦sÀx©MºûÅ@³o¨Ç¸ê°Tªº¤èªk¡C¸ê®Æ®w¨t²Î¥D­n¥Ñ¤T¤j³¡¤À¸s¸s²Õ¦¨¡G¸ê®Æ®wºÞ²z¨t²Î¡]DBMS:¥¦¬O±Mªù­t³d¸s¸s²Õ´©MºÞ²z¼Æ¾Ú¸ê°Tªºµ{¦¡¡^¡B ¸ê®Æ®wÀ³¥Îµ{¦¡¡]¥¦¨Ï§Ú­Ì¯à°÷Àò¨ú¡BÅã¥Ü©M§ó·s¥ÑDBMS¦sÀxªº¼Æ¾Ú¡^¡B¸ê®Æ®w¡]«ö¤@©wµ²ºc¸s¸s²Õ´¦b¤@°_ªº¬ÛÃö¼Æ¾Úªº¶°¦X¡^¡C

        ¤@¯ë¨Ó»¡¡ADBMS©M¸ê®Æ®wÀ³¥Îµ{¦¡³£¾n¯d¦b¦P¤@¥x¹q¸£¤W¨Ã¦b¦P¤@¥x¹q¸£¤W°õ¦æ¡A«Ü¦h±¡ªp¤U¨âªÌ¬Æ¦Üµ²¦X¦b¦P¤@­Óµ{¦¡¤¤¡A¥H«e¨Ï¥Îªº¤j¦h¼Æ¸ê®Æ®w¨t²Î³£¬O¥Î³oºØ¤èªk³]­pªº¡C¦ý¬OÀHµÛDBMS§Þ³Nªºµo®i¡A¥Ø«eªº¸ê®Æ®w¨t²Î¥¿¦V¥Î¤á/¦øªA¾¹¼Ò¦¡µo®i¡C¥Î¤á/¦øªA¾¹¸ê®Æ®w±NDBMS©M¸ê®Æ®wÀ³¥Îµ{¦¡¤À¶}¡A±q¦Ó´£°ª¤F¸ê®Æ®w¨t²Îªº³B²z¯à¤O¡C¸ê®Æ®wÀ³¥Îµ{¦¡°õ¦æ¦b¤@­Ó©Î¦h­Ó¥Î¤á¤u§@¯¸¡]¥Î¤á¾÷¡^¤W¡A¨Ã¥B³q¹Lºô¸ô»P°õ¦æ¦b¨ä¥¦¹q¸£¤W¡]¦øªA¾¹¡^ªº¤@­Ó©Î¦h­ÓDBMS¶i¦æ³q«H¡C

¡@ ¤U­±¬O¸ê®Æ®w¨t²Î¤¤¤@¨Ç·§©À©M­z»y¡C¡@

13.1.1 ¸ê®Æ®wºÞ²z¨t²Î¡]DBMS¡^¡@

        ¸ê®Æ®wºÞ²z¨t²Î¡]DBMS¡^¬O¥Î©ó´y­z¡BºÞ²z©MºûÅ@¸ê®Æ®wªºµ{¦¡¨t²Î¡A¬O¸ê®Æ®w¨t²Îªº®Ö¤ß¸s¸s²Õ¦¨³¡¤À¡C¥¦«Ø¥ß¦b§@·~¨t²Îªº°ò¦¤W¡A¹ï¸ê®Æ®w¶i¦æ²Î¤@ªººÞ²z©M±±¨î¡C¨ä¥D­n¥\¯à¦³¡G

1. ´y­z¸ê®Æ®w:´y­z¸ê®Æ®wªºÅÞ¿èµ²ºc¡B¦sÀxµ²ºc¡B»y¸q¸ê°T©M«O±K­n¨Dµ¥¡C

2. ºÞ²z¸ê®Æ®w¡G±±¨î¾ã­Ó¸ê®Æ®w¨t²Îªº°õ¦æ¡A±±¨î¥Î¤áªº¨Ãµo©Ê¦s¨ú¡AÀËÅç¼Æ¾Úªº¦w ¥þ¡B«O±K»P§¹¾ã©Ê¡A°õ¦æ¼Æ¾ÚÀ˯Á¡B´¡¤J¡B¸Ñ°£¡B­×§ïµ¥¾Þ§@¡C

3.ºûÅ@¸ê®Æ®w:±±¨î¸ê®Æ®wªì©l¼Æ¾Úªº¸ü¤J¡A°O¿ý¤u§@¤é»x¡AºÊµø¸ê®Æ®w©Ê¯à¡A­×§ï§ó·s¸ê®Æ®w¡A­«·s¸s¸s²Õ´¸ê®Æ®w¡A«ì´_¥X²{¬G»Ùªº¸ê®Æ®w¡C

4.¼Æ¾Ú³q«H :¸s¸s²Õ´¼Æ¾Úªº¶Ç¿é¡C

        DBMS¥D­n¦³¥|ºØ«¬¦¡:¤å¥óºÞ²z¨t²Î¡B¼h¦¸¸ê®Æ®w¨t²Î¡B ºôª¬¸ê®Æ®w¨t²Î©MÃö«Y¸ê®Æ®w¨t²Î¡C¦]¬°¥Ø«eÃö«Y¸ê®Æ®w¨t²ÎÀ³¥Î³Ì¬°¼sªx¡A©Ò¥H§Ú­Ì­«ÂI¹ïÃö«Y¸ê®Æ®w¨t²Î¤¤ªº´X­Ó·§©À¶i¦æ¤¶²Ð¡C

        Ãö«Y¸ê®Æ®w¡]Relational Database¡^:¤@­ÓÃö«Y¸ê®Æ®w¬O¥Ñ­Y¤zªí¸s¸s²Õ¦¨¡C¦bDelphi¤¤¡A¸ê®Æ®w·§©À¹ïÀ³¨ìª«²z¤å¥ó¤W¬O¦³¤@¨Ç¤£¦Pªº¡C¹ï©ódBASE¡BFoxPro¡BParadox³o¤TºØ¸ê®Æ®w¨t²Î¡A¸ê®Æ®w¹ïÀ³©ó¬Y¤@­Ó¤l¥Ø¿ý¡A¦Ó¨ä¥¦«¬¦¡¦pMS Access¡BBtrieve«h¬O«ü¬Y­Ó¤å¥ó¡C³o¬O¦]¬°«eªÌªºªí¬°³æ¿Wªº¤å¥ó¡A¦Ó«áªÌªºªí¬O»E¶°¦b¤@­Ó¸ê®Æ®w¤å¥ó¤¤ªº¡C

        ªí¡]Table¡^:¤@­Óªí´N¬O¤@¸s¸s²Õ¬ÛÃöªº¼Æ¾Ú«ö¦æ±Æ¦C¡A¶H¤@±iªí®æ¤@¼Ë¡C¤ñ¦p¤@­Ó¯Z©Ò¦³¾Ç¥Íªº´Á¥½¦Ò¸Õ¦¨ÁZ¡A¦s¦b¤@­Óªí¤¤¡A¨C¤@¦æ¹ïÀ³¤@¦W¾Ç¥Í¡A¦b³o¤@¦æ¤¤¡A¥]¬A¾Ç¥Íªº¾Ç¸¹¡B©m¦W¥H¤Î¦Uªù½Òµ{ªº¦¨ÁZ¡C

        Äæ¦ì¡]Field¡^:¦bªí¤¤¡A¨C¤@¦CºÙ¬°¤@­ÓÄæ¦ì¡C¨C¤@­ÓÄæ¦ì³£¦³¬ÛÀ³ªº´y­z¸ê°T¡A¦p¼Æ¾Ú«¬¦¡¡B¼Æ¾Ú¼e«×µ¥¡C

°O¿ý¡]Record¡^:¦bªí¤¤¡A¨C¤@¦æºÙ¬°¤@±ø°O¿ý¡C

¯Á¤Þ¡]Index¡^:¬°¤F¥[§Ö¦s¨ú¸ê®Æ®wªº³t«×¡A³\¦h¸ê®Æ®w³£¨Ï¥Î¯Á¤Þ¡C¡@

13.1.2 ¸ê®Æ®wÀ³¥Îµ{¦¡

         DBMS¤¤¦sÀx¤F¤j¶qªº¼Æ¾Ú¸ê°T¡A¨ä¥Øªº¬O¬°¥Î¤á´£¨Ñ¼Æ¾Ú¸ê°TªA°È¡A¦Ó¸ê®Æ®wÀ³¥Îµ{¦¡¥¿¬O»PDBMS¶i¦æ³q«H¡A¨Ã¦s¨úDBMS¤¤ªº¼Æ¾Ú¡A¥¦¬ODBMS¹ê²{¨ä¹ï¥~´£¨Ñ¼Æ¾Ú¸ê°TªA°È³o¤@¥Øªºªº°ß¤@³~®|¡C²³æ¦a»¡¡A¸ê®Æ®wÀ³¥Îµ{¦¡¬O¤@­Ó¤¹³\¥Î¤á´¡¤J¡B­×§ï¡B¸Ñ°£¨Ã³ø§i¸ê®Æ®w¤¤ªº¼Æ¾Úªº¹q¸£µ{¦¡¡C¸ê®Æ®wÀ³¥Îµ{¦¡¦b¶Ç²Î¤W¬O¥Ñµ{¦¡­û¥Î¤@ºØ©Î¦hºØ¤@¯ëªº©Î±M¥Îªºµ{¦¡³]­p»y¨¥½s¼gªº¡A¦ý¬Oªñ¦~¨Ó¥X²{¤F¦hºØ­±¦V¥Î¤áªº¸ê®Æ®wÀ³¥Îµ{¦¡¶}µo¤u¨ã¡A³o¨Ç¤u¨ã¥i¥H²¤Æ¨Ï¥ÎDBMSªº¹Lµ{¡A¨Ã¥B¤£»Ý­n±Mªùµ{¦¡³]­p¡CDelphi´N¬O¤@ºØ±j¦³¤Oªº¸ê®Æ®wÀ³¥Îµ{¦¡¶}µo¤u¨ã¡C

¥Î¨Ó²£¥Í¸ê®Æ®wÀ³¥Îµ{¦¡ªº»y¨¥¥D­n¤À¬°¤T¤j«¬¦¡:

1.¹Lµ{¤Æ»y¨¥

        ¼Ð·Çªº¹q¸£µ{¦¡³]­p»y¨¥¦pPascal¡BBasic©MC³£¬O¹Lµ{¤Æ»y¨¥¡A³o¨Ç»y¨¥¥i¥H³q¹L¬YºØ¡§À³¥Îµ{¦¡±µ¤f¡¨¡]API¡^¨Ó«Ø¥ß¸ê®Æ®wÀ³¥Îµ{¦¡¡A³oºØAPI¥Ñ¤@¸s¸s²Õ¼Ð·Çªº¨ç¼Æ¡]©Î©I¥s¡^¸s¸s²Õ¦¨¡A³o¨Ç¨ç¼Æ©M©I¥s«hÂX®i¤F»y¨¥ªº¥\¯à¡A¨Ï¤§¯à¦s¨ú¸ê®Æ®w¤¤ªº¼Æ¾Ú¡C·íµ{¦¡³]­p¤H­û¥Î¹Lµ{¤Æ»y¨¥«Ø¥ß¸ê®Æ®wÀ³¥Î®É¡A¥²¶·§âÀ³¥Îªº¥N½X½s¼g¦¨¤@¨t¦Cªº¹Lµ{¡A¨C­Ó¹Lµ{°õ¦æÀ³¥Îªº¬Y¤@³¡¤Àªº¤u§@¡A¦p¤@­Ó¹Lµ{¬d¸ß¸ê®Æ®w¡A¦Ó¥t¤@¹Lµ{§ó·s¸ê®Æ®w¤¤ªº¼Æ¾Ú¡AµM«á¤£¦Pªº¹Lµ{³q¹L¨ä¥Lªº¥Î¤á¤¶­±¹Lµ{¡]¨Ò¦p¿ï¾Üªí¨t²Î¡^Ápô¦b¤@°_¡A¨Ã¥B¦bÀ³¥Î¤¤ªº¾A·í¦a¤è°õ¦æ¡C

        ¤W­z³o¨Ç¹Lµ{¤Æ»y¨¥¤@¯ë¥Î¨Ó«Ø¥ß«D¸ê®Æ®wÀ³¥Îµ{¦¡¡A¥¦­Ì³q±`³QºÙ¬°¡§²Ä¤T¥N»y¨¥¡¨¡]3GL¡^¡CÁÙ¦³¤@¨Ç¹Lµ{¤Æµ{¦¡³]­p»y¨¥¬O¬YºØ¯S©wªºDBMS±M¥Îªº¡A ³o¨Ç»y¨¥¤@¯ë³QºÙ¬°¡§²Ä¥|¥N»y¨¥¡¨¡]4GL¡^¡A§Y¸ê®Æ®w±M¥Î»y¨¥¡C±`¨£ªº¸ê®Æ®w±M¥Îªº¹Lµ{¤Æ»y¨¥¦pdBASE»y¨¥¡AParadox¸ê®Æ®wªºPAL»y¨¥µ¥µ¥¡C

2.µ²ºc¤Æ¬d¸ß»y¨¥¡]SQL¡^

       µ²ºc¤Æ¬d¸ß»y¨¥¡]Structure Query Language¡^¬O°ò©óÃö«Y¼Ò«¬ªº¸ê®Æ®w¬d¸ß»y¨¥¡A¥¦¬O¤@ºØ«D¹Lµ{¤Æªºµ{¦¡»y¨¥¡A¤]´N¬O»¡¡A¨S¦³¥²­n¼g¥X±N¦p¦ó°µ¬Y¨Æ±¡¡A¥u»Ý¼g¥X°µ¨ì¤°»ò´N¥i¥H¤F¡C¼g¥Xªº»y¥y¥i¬Ý§@¬O¤@­Ó°ÝÃD¡AºÙ¬°¡§¬d¸ß¡¨¡]Query¡^¡A°w¹ï³o­Ó¬d¸ß¡A±o¨ì©Ò»Ýªº¬d¸ßµ²ªG¡C¤U­±¬O¤@­Ó¨Ò¤l¡G¡@

Select Name,Total from Class where Total>600¡@

        ³o­Ó¬d¸ß·N¬°±q¸ê®Æ®wªíClass¤¤±NÁ`¤À¡]Total¡^¤j©ó600ªº©Ò¦³¤H¿ï¥X¨Ó¡A ¨Ã¦C¥X¥L­Ìªº©m¦W(Name)©MÁ`¤À(Total)¡C

        §âSQL´y­z¬°¤l»y¨¥§ó¾A·í¤@¨Ç¡A¦]¬°¥¦¨S¦³¥ô¦ó¿Ã¹õ³B²z©Î¥Î¤á¿é¤J/¿é¥Xªº¯à¤O¡C¥¦ªº¥D­n¥Øªº¬O¬°¤F´£¨Ñ¦s¨ú¸ê®Æ®wªº¼Ð·Ç¤èªk¡A¦Ó¤£ºÞ¸ê®Æ®wÀ³¥Îªº¨ä¾l³¡¤À¬O¥Î¤°»ò»y¨¥½s¼gªº¡A¥¦¬J¬O¬°¸ê®Æ®wªº¤¬°Ê¦¡¬d¸ß¦Ó³]­pªº¡]¦]¦¹³QºÙ¬°°ÊºASQL¡^¡A ¦P®É¤]¥i¦b¹Lµ{¤Æ»y¨¥½s¼gªº¸ê®Æ®wÀ³¥Îµ{¦¡¤¤¨Ï¥Î¡]¦]¦¹³QºÙ¬°´O¤J¦¡SQL¡^¡C

3.¨ä¥L»y¨¥

        ¥Î©ó¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡ªº»y¨¥¤¤¡AÁÙ¥i¥H¨Ï¥Î¥Ø«e¼Æ±`¨£ªº¡§­±¦Vª«¥óµ{¦¡³]­p¡¨¡]OOP¡^»y¨¥¡A¦pC++¡B Objact Pascalµ¥¡AOOP¥Nªí¤F¤@ºØ§¹¥þ¤£¦Pªºµ{¦¡³]­p¤èªk¡A ¦b³oºØµ{¦¡³]­p¤èªk¤¤¡A¬¡°Ê³Q©w¸q¬°¦b¡§ª«¥ó¡¨¤Wµo¥Íªº¾Þ§@¡A¦Ó¤£¬O§@¬°¤@¨t¦C¹Lµ{¨Ó©w¸qªº¡C¦b¸ê®Æ®wÀ³¥Îµ{¦¡¤¤¨Ï¥ÎOOP»y¨¥ªº±¡ªp¥¿¦b¤£Â_¼W¥[¡C

        ¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡¨Ï¥Îªº¥t¤@ºØ»y¨¥¬O¡§§»¡¨»y¨¥¡C§»»y¨¥¤£¬O¤@ºØ§¹¥þªºµ{¦¡³]­p»y¨¥¡A¥¦¹ê»Ú¤W¬O¤@­Ó¥Î¤á¤â¤u¿é¤Jªºªí¡A³o­Óªí³Q¿é¤J¨ìÀ³¥Îµ{¦¡¤¤¡A¥H«K¦Û°Ê°õ¦æ¤@©wªº¥ô°È¡C¹ï©ó¬Y­Ó¯S©wÀ³¥Îªº¶i¶¥»y¨¥¡A§»»y¨¥³q±`¥i¥H¦b§CÀÉDBMS³nÅ餤©Î¸ê®Æ®w¦øªA¾¹ªº«eºÝ¤¤§ä¨ì¡C

         ³Ì«á¡AÁÙ¦³¤@ºØ¡§Query-By-Example¡¨¡]QBE¡A½d¨Ò¬d¸ß¡^»y¨¥¡CÄY®æ¦aÁ¿QBE¤£¬O¤@ºØ»y¨¥¡A¥¦¬O­±¦V¥Î¤á´£¨Ñ¤F¤@­Ó©Î¦h­ÓªÅªíªº¤¶­±¡A³o¨ÇªÅªí¹ïÀ³©ó¸ê®Æ®w¤¤ªºªí¡C¥Î¤á¥i¥H³q¹LÁä½L¿ï¾Ü»Ý­n¬d¸ßªº¦C¡A¨Ã¦b¾A·íªº¦C¤¤¶ñ¤J±ø¥ó±q¦Ó©w¸q¬d¸ßªºÀ˯Á±ø¥ó¡AµM«áDBMS´N§âQBEÂà´«¦¨¬ÛÀ³ªº°Ê§@¡A¥H§¹¦¨¥Î¤á­n¨Dªº¬d¸ß¥ô°È¡C¡@

13.2 Delphiªº¸ê®Æ®w¯S©Ê¤Î¥\¯à²¤¶¡@

        ª½¨ì¥Ø«e¬°¤î¡A¹q¸£³nÅ骺¶}µo¤À¬°¨â­Ó¤£¦PªºÅé¨t¡A¨ä¤¤¤@­ÓÅé¨t¬O¨Ï¥Î¶Ç²Îªºµ{¦¡³]­p»y¨¥¡]¦pPascal¡BBasic©MCµ¥¡^¶}µo¼Æ­È±±¨î¡B¼Æ­È¹Bºâµ¥³nÅé¡A³ò¶¥¦­Ìªº­«ÂI¬Oºâ³N¡B¼Æ¾Úµ²ºc¥H¤Îªñ¦~²£¥Íªº­±¦Vª«¥ó§Þ³N¡C¥t¤@­ÓÅé¨t«h¬O¤@¯ëªºªº¸ê®Æ®wºÞ²z³nÅé»âÄæ¦ì¡]¸ê®Æ®wÀ³¥Îµ{¦¡ªº¶}µo¡^¡C³o¨â­ÓÅé¨tªºµo®i³£·¥¬°¨³²r¡A¦ý¬O¤GªÌ¨Ã¨S¥X²{²V¦Xº¯³z¸ñ¶H¡C¦pªG¨Ï¥Î¸ê®Æ®w»y¨¥¶i¦æ¶Ç²Îªººâ³Nµ{¦¡³]­p¡AÁöµM¤]¯à§¹¦¨¬ÛÀ³ªº¥\¯à¡A¦ý¬O¨äµ{¦¡³]­p¹Lµ{¥i¯à·¥¬°½ÆÂø¡C¦pªG¨Ï¥Î¶Ç²Îªºµ{¦¡³]­p»y¨¥¶i¦æ¸ê®Æ®wµ{¦¡³]­p¡A³q¹L©I¥s±M¥Îªº¸ê®Æ®wÀ³¥Îµ{¦¡±µ¤f¨ç¼Æ©M¹Lµ{¡A§Q¥Î³o¨Ç¨ç¼Æ©M¹Lµ{´£¨Ñªº¥\¯à¡A¥i¯à¤]¯à°µ±o¤ñ¸û§¹µ½¡A¦ý³o°µ°_¨Ó¤j¦h¬O·¥¨ä§xÃøªº¡C¦ÓDelphiµ²¦X¤F¨â­ÓÅé¨tªºÀuÂI¡A¥¦µ²¦X¤F¶Ç²Îªºµ{¦¡³]­p»y¨¥Object Pascal©M¸ê®Æ®w»y¨¥ªº±j¤j¥\¯à¡A ¥¦§Y¥i¥H¥Î©ó¶Ç²Îªººâ³Nµ{¦¡³]­p¤S¥i¥H¥Î©ó¸ê®Æ®wµ{¦¡³]­p¡A¯S§O¬ODelphi¨ã¦³±j¤jªº¸ê®Æ®w¥\¯à¡A§Q¥ÎDelphiªº¸ê®Æ®w¤u¨ã¡A§Ú­Ì®Ú¥»¤£»Ý­n½s¼g¥ô¦óObject Pascal¥N½X«K¥i¥H«Ø¥ß¤@­Ó²³æªº¸ê®Æ®wÀ³¥Î¡C

        Delphi¬OBorland¤½¥q©ó1994¦~©³µo§Gªº¥Î©ó¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡ªº¤u¨ã¡A ¥¦¬O­±¦Vª«¥óªº¡A¥¦¬O¥Ø«e¶}µo¥Î¤á/¦øªA¾¹¸ê®Æ®wÀ³¥Îµ{¦¡ªº±j¦³¤Oªº¤u¨ã¡CDelphi¦bWindow3.1¥H¤Wª©¥»ªº¨t²ÎÀô¹Ò¤U°õ¦æ¡A¥Ø«e¨ã¦³¨â­Óª©¥»¡GDelphiªº¼Ð·Çª©¥»©M¥Î¤á/¦øªA¾¹ª©¥»¡C¼Ð·Çª©¥»¥]§t¤@­ÓBorland Database Engineªº§½³¡«þ¨©¡A¥¦¤¹³\¥Î¤á«Ø¥ß¯à¦s¨údBASE¡BParadox©MLocal InterBase ¦øªA¾¹ªº¸ê®Æ®wÀ³¥Î¡A ¥¦Á٤䴩¨ã¦³ ODBC ±µ¤fªº¸ê®Æ®w¡CDelphiªº¥Î¤á/¦øªA¾¹ª©¥»¥]¬ABorland SQL Link¡A ¥¦¯àª½±µ¦s¨ú ORACLE ¡B SyBase ©MMicrosoft SQL Server,Informix¥H¤ÎInterBase¸ê®Æ®w¦øªA¾¹¡C

        Delphi¥i¥H¦s¨ú¦hºØ¸ê®Æ®wºÞ²z¨t²Îªº¸ê®Æ®w¡A¾Ì­Éµ¡Åé(Forms)©M³øªí(Reports)¡ABDE(Borland Database Engine)¥i¥H¦s¨ú½Ñ¦pParadox¡BdBASE¡B¥»¦aInterBase ¦øªA¾¹ªº¸ê®Æ®w¡A¤]¥i¥H¦s¨ú»·ºÝ¸ê®Æ®w¦øªA¾¹¤Wªº¸ê®Æ®w(¦pORACLE¡BSyBase¡BInformixµ¥¥Î¤á/¦øªA¾¹¸ê®Æ®w¤¤ªº¸ê®Æ®w)¡A©Î¥ô¦ó¸gODBC(Open Database Connecticity) ¥i¦s¨úªº¸ê®Æ®wºÞ²z¨t²Î¤¤ªº¸ê®Æ®w¡C¡@

13.2.1 Delphiªº¸ê®Æ®w¯S©Ê¡@

        ¸ò¨ä¥LªºÀ³¥Îµ{¦¡¤@¼Ë¡ADelphi´£¨Ñ¤F³\¦h³¡¥ó¥H¤è«K¦a«Ø¥ß¸ê®Æ®wÀ³¥Îµ{¦¡¡C¸ê®Æ®wª«¥óªº¼Æ¾Ú¦¨­û¬J¥i¦b³]­p¶¥¬q³]©w¡A¤]¥i¦b°õ¦æ¶¥¬q³q¹Lµ{¦¡¥N½X¶i¦æ³]©w¡CDelphiªº³¡¥óªO¤W´£¨Ñ¤F¨â­¶¸ê®Æ®wÀ³¥Îµ{¦¡¶}µo¤¤©Ò­n¨Ï¥Îªº³¡¥ó¡G

        ¼Æ¾Ú¦s¨ú­¶¡]Data Access Page¡^¤Wªº³¡¥ó¥Î©óª½±µ¦s¨ú¸ê®Æ®w¤¤ªº¸ê®Æ®wªí¡C

        ¼Æ¾Ú±±¨î­¶¡]Data Control Page¡^¤Wªº³¡¥ó¥Î¨Ó»P¥Î¤á¤¬°Ê¡AÅã¥Ü¡B ­×§ï¸ê®Æ®w¤¤ªº¼Æ¾Ú¡C

¸ê®Æ®wÀ³¥Îµ{¦¡­º¥ý¬O§Q¥ÎDelphi´£¨Ñªº¸ê®Æ®w³¡¥ó»PBDE«Ø¥ßÁpô¡AµM«á¦A³q¹LBDE»P¸ê®Æ®wÁpô¡C¤U¹ÏÄÄ­z¤FDelphiªº¸ê®Æ®w¤u¨ã©M³¡¥ó¡BDelphi¸ê®Æ®wÀ³¥Îµ{¦¡»PBDE ¡B¼Æ¾Ú·½¤§¶¡ªºÃö«Y¡C

¤Uªí·§¬A¤FDelphiªº¸ê®Æ®w¯S©Ê¡G¡@

ªí13.1 Delphiªº¸ê®Æ®w¯S©Ê

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

¡@ ¤u¨ã©M³¡¥ó ¡@ ¥D ­n ¥Î ³~ ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@Data Access Components ¡@¦s¨ú¸ê®Æ®w¡B¸ê®Æ®wªí¡B¦s¶J¹Lµ{µ¥ ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@Data Control Components ¡@»P¥Î¤á¤¬°Ê¡A´£¨ÑÅã¥Ü¡B­×§ï¸ê®Æ®w¤¤¼Æ¾Úªº¤¶­± ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@Database Desktop(DBD) ¡@«Ø¥ß¡B¯Á¤Þ¡B¬d¸ß¸ê®Æ®wªí¥H¤Î¦s¨ú¡B½s¿è¨Ó¦Û¦U¼Æ¾Ú¡@

¡@ ¡@¤¤ªº¼Æ¾Ú ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@ReportSmith ¡@«Ø¥ß¡BÂsÄý©M¦C¦L¸ê®Æ®wªí¤¤ªº¼Æ¾Ú ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@Borland Database Engine ¡@¸ê®Æ®wÀ³¥Î³q¹LBDE¦s¨údBASE Paradox¸ê®Æ®w¤¤ªº¼Æ¾Ú¡@

¡@ (BDE) ¡@©M¥»¦aInterBase¸ê®Æ®w¦øªA¾¹¤¤ªº¼Æ¾Ú

¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@ BDE Configuration ¡@«Ø¥ß©MºÞ²zBDE»P¸ê®Æ®w«Ø¥ß³s±µ®É©Ò¨Ï¥Îªº¸ê®Æ®wªº ¡@

¡@ Utility ¡@§O¦W ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@ ¡@¥¦¬O¤@­Ó³æ¥Î¤á¡B¦h¨Òµ{ªº¥»¦aSQL¸ê®Æ®w¦øªA¾¹¡A¥i ¡@

¡@Local InterBase Server ¡@¦b³æ¾÷Àô¹Ò¤U¥Î¨Ó¶}µo©Î´ú¸Õ¥Î¤á/¦øªA¾¹¸ê®Æ®wÀ³¥Î ¡@

¡@ ¡@µ{¦¡¡AµM«á¦A±N¤§ÂX®i¦¨¤@­Ó¦s¨ú»·ºÝ¸ê®Æ®w¦øªA¾¹¦p¡@

¡@ ¡@ORACLE¡BSyBase¡BInformixµ¥ ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡@

¡@InterBase SQL Link ¡@³s±µDelphi¸ê®Æ®wÀ³¥Îµ{¦¡¤@¥»¦aInterBase¦øªA¾¹ªº ¡@

¡@ ¡@ÅX°Êµ{¦¡ ¡@

Delphi¤W­z³o¨Ç¯S©Ê¨Ï±o§Ú­Ì«Ø¥ß¸ê®Æ®wÀ³¥Îµ{¦¡³q¹LBDE¯à°÷«ÜÆF¬¡¦a»P dBASE ¡BParadox¡BLocal InterBase¸ê®Æ®w¦øªA¾¹¶i¦æ³s±µ¨Ã¥i¥H¤è«K¦a¦s¨ú¨ä¤¤ªº¼Æ¾Ú¡C§Ú­Ì¦b«Ø¥ß¤@­Ó²³æªº¸ê®Æ®wÀ³¥Î®É³q¹L¨Ï¥ÎDelphi´£¨Ñªº¤W­z¤u¨ã©M³¡¥ó¬Æ¦Ü¥i¥H¤£»Ý½s¼g¥ô¦óµ{¦¡¡C

BDE³Q¦Û°Ê¦a¥]§t¦bDelphi¤¤¡A¦]¦¹¡A§Ú­Ì¦b«Ø¥ß¸ê®Æ®wÀ³¥Îµ{¦¡®É¡A¤£¥²Ãö¤ßBDEªº¦³Ãö¤º®e¡CDelphiªº¸Ë³]µ{¦¡¦Û°Ê¬°Paradox¡BdBASE©M¥»¦aInterBaseServer ¸Ë³]¬ÛÀ³ªºÅX°Êµ{¦¡¡A¨Ã«Ø¥ß¤F¦³Ãöªº²ÕºA¡ADBE Configuration Utility ¥i¥H«Ø¥ßÀ³¥Îµ{¦¡»P¸ê®Æ®wªº³s±µ¸ê°T¡AÁÙ¥i¥H¬°¸ê®Æ®w³]©w§O¦W¡C

¤Uªí¦C¥X¤FDelphi¶}µoClient/ServerÀ³¥Îµ{¦¡ªº¦³Ãö¯S©Ê¡A³o¨Ç¯S©ÊÂX®i¤F Delphi¦s¨ú»·ºÝ¸ê®Æ®wªº¥\¯à¡A¦pSQL¸ê®Æ®w¦øªA¾¹¡]ORACLE¡BSyBase¡BInformix¡B Microsoft SQL Server¡BInterBase¡^¡C¡@

ªí13.2 Delphi Client/server¸ê®Æ®w¯S©Ê

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

¤u ¨ã ¡@ ¥D ­n ¥Î ³~

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@SQL Drivers¤¤ªºSQL link©MReportSmith¬°

SQL Drivers ¡@Delphi¸ê®Æ®wÀ³¥Îµ{¦¡´£¨Ñ¤F¦s¨ú»·ºÝSQL

¡@¦øªA¾¹ªºÅX°Êµ{¦¡¡A¦p¦s¨úORACLE¡BSyBase¡B

¡@Microsoft SQL server¡BInformix¡BIntermix

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

Visual Query Builder¡@¥H¥iµø¤Æªº¤è¦¡«Ø¥ßSQL»y¥y¹ï¸ê®Æ®wªí©Mªí

¡@¤¤ªº°O¿ý¶i¦æ¾Þ§@

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

¡@

SQL links¨Ï±oDelphi¸ê®Æ®wÀ³¥Îµ{¦¡§Q¥ÎSQL»y¨¥¦s¨ú¾n¯d¦b»·ºÝ¦øªA¾¹¤Wªº¼Æ¾Ú¡A³o¨Ç¦øªA¾¹¥]¬AORACLE¡BSybase¡BMicrosoft SQL Server¡BInformix¡BInterBase¡C ·í¸Ë³]SQL LinkÅX°Êµ{¦¡¤§«á¡ASQL»y¥y«K¥i¥Hª½±µ¾Þ§@¦øªA¾¹¤Wªº¼Æ¾Ú¡C

¡@

13.2.2 Delphi¥i¥H¦s¨úªº¼Æ¾Ú·½¡]DataSource¡^

¡@

Delphi¸ê®Æ®wÀ³¥Îµ{¦¡¬O³q¹LBDEÀò¨ú¥¦­Ì©Ò»Ýªº¼Æ¾Úªº¡ABDE»P¤£¦P«¬¦¡ªº¼Æ¾Ú·½¥´¥æ¹D¡ABDE¥i¥H¨Ï¥Îªº¼Æ¾Ú·½¦³¦pªí13.3©Ò¥Ü

¡@

ªí13.3 Delphi¥i¦s¨úªº¼Æ¾Ú·½

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

¼Æ¾Ú·½(DataSource) ¡@ ¯S ©Ê ´y ­z ¡@¤å¥óÀɮתþ¥[¦W

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@¸ê®Æ®wªí¬O³q¹LdBASE¸ê®Æ®wºÞ²z¨t²Î©Î ¡@

dBASE¸ê®Æ®w ¡@DBD«Ø¥ßªº¡A¨C­Óªí¬O¤@­Ó¿W¥ßªº¤å¥ó ¡@.DBF

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@¸ê®Æ®wªí¬O³q¹LParadox¸ê®Æ®wºÞ²z¨t²Î ¡@.DB

Paradox¸ê®Æ®w ¡@©ÎDBD«Ø¥ßªº¡A¨C­Óªí¬O¤@­Ó¿W¥ßªº¤å¥ó ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

ASCII¤å¥ó ¡@ªí¬O³q¹LDatabase Desktop«Ø¥ßªº,¨C­Ó ¡@.TXT

¡@ªí¬O¤@­Ó¿W¥ßªº¤å¥ó ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¥»¦aInterBase¦øªA¾¹ ¡@¸ê®Æ®w¬O³q¹LInterBase¸ê®Æ®wºÞ²z¨t²Î ¡@.GDB

¡@«Ø¥ßªº,¦h­Óªí¥]§t¦b¤@­Ó¸ê®Æ®w¤å¥ó¤¤ ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

SQL¸ê®Æ®w¦øªA¾¹: ¡@¸ê®Æ®w¬O³q¹L¬ÛÀ³ªº¸ê®Æ®w¦øªA¾¹´£¨Ñªº¡@¨Ì¿à¤£¦Pªº

ORACLE,Sybase,Informix¡@±M¥Î©Î¤@¯ëªº¤u¨ã«Ø¥ßªº,¤]¥i¥H³q¹LDBD¨Ó¡@¸ê®Æ®wºÞ²z

Microsoft SQL Server ¡@«Ø¥ß¸ê®Æ®w,¨Ã³q¹LSQL Link¦s¨ú¸ê®Æ®w ¡@¨t²Î

InterBase ¡@ ¡@

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

ODBC¼Æ¾Ú·½ ¡@¥D­n¬O«ü¨º¨Ç¨ã¦³ODBC±µ¤fªº¸ê®Æ®w¨t²Î¡@¨Ì¿à©ó¬ÛÀ³

¡@¦pMS Access,Btrieveµ¥ ¡@ªº¸ê®Æ®w

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

13.3 Delphi¸ê®Æ®wªºÅé¨tµ²ºc¡@

        Delphi¨Ï¥Î¥iµø¤Æªº³¡¥ó«Ø¥ß¸ê®Æ®wÀ³¥Î¡A¸ò«Ø¥ß¨ä¥¦ªº«D¸ê®Æ®wÀ³¥Îµ{¦¡¤@¼Ë¡A¸ê®Æ®w³¡¥ó³£¨ã³Æ¤@©wªºÄÝ©Ê¡Aµ{¦¡³]­p¤H­û¥i¥H¦b³]­p¹Lµ{¤¤³]©w³¡¥óªº¦hºØÄÝ©Ê¡A¤]¥i¥H¦bµ{¦¡°õ¦æ¹Lµ{¤¤³q¹Lµ{¦¡¨Ó³]©w³¡¥óªº¦UºØÄÝ©Ê¡C

        ¦bDelphi³¡¥óªO¤W¦³¨â­¶¸ê®Æ®w³¡¥ó¥Î©ó¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡¡G

        ¼Æ¾Ú¦s¨ú³¡¥ó­¶¡G¸Ó­¶¤Wªº³¡¥ó¥D­n¥Î©ó±Ô­z¦³Ãöªº¸ê®Æ®wªº¸ê°T¡A¦pÀ³¥Îµ{¦¡­n¦s¨ú(³s±µ)ªº¸ê®Æ®w¡A­n¦s¨ú¸ê®Æ®w¤¤ªº¨ãÅ骺¸ê®Æ®wªí¡A¥H¤Î­n¦s¨úªí¤¤­þ¨ÇÄæ¦ìµ¥¡A¦b¹ê»Úªº¶}µoÀ³¥Î¤¤±`¥Îªº³¡¥ó¦³TDataSource¡BTTable¡BTQueryµ¥¡C

        ¼Æ¾Ú±±¨î³¡¥ó­¶¡G¸Ó­¶¤Wªº³¡¥ó¥D­n¥Î©óÅã¥ÜÂsÄý¸ê®Æ®w¤¤ªº¼Æ¾Ú¸ê°T¡A¬°¥Î¤á´£¨Ñ¤F¤@­Ó¥iµø¤Æªº¤¶­±¡A±`¥Îªº³¡¥ó¦³¡GTDBGrid¡BTDBEdit¡BTDBCheckµ¥¡A¥i¥HÅý¥Î¤á¹ï¸ê®Æ®w¤¤ªº¸ê°T¶i¦æ¦³®ÄªºÂsÄý¡B½s¿è¡B´¡¤J¡B¸Ñ°£µ¥¾Þ§@¡C

        TTable¡BTQuery¡BTStoredproc³¡¥ó­t³d»P¹ê»Úªº¸ê®Æ®wªíÁpô¡A ¨Ã±q¤¤Àò¨ú¼Æ¾Ú¸ê°T¡A¦]¦Ó¥¦­Ì¤S±`±`³QºÙ¬°¼Æ¾Ú¶°³¡¥ó¡A¥¦­Ì¦bµ{¦¡³]­p¹Lµ{¤¤¬O¥i¨£ªº¡A¦ý¦bµ{¦¡°õ¦æ®É¬O¤£¥i¨£ªº¡A ¥¦­Ì³q¹L BDE ¬°À³¥Îµ{¦¡´£¨Ñ»P¸ê®Æ®wªº³s±µ¡A ¼Æ¾Ú±±¨î³¡¥ó³q¹LTDataSource³¡¥ó»P¼Æ¾Ú¶°³¡¥ó¬Û³s¡A¬°¥Î¤á´£¨Ñ¤@­Ó¥iµø¤Æªº¤¶­±¡A ¨Ã¦b¨ä¤¤Åã¥Ü¸ê®Æ®w¤¤ªº¼Æ¾Ú¸ê°T¡C

13.3.1 ¼Æ¾Ú¦s¨ú³¡¥ó¡@

¼Æ¾Ú¦s¨ú³¡¥ó­¶¤W´£¨Ñ¤F¤@¸s¸s²Õ¼Æ¾Ú¦s¨ú³¡¥ó¥Î¨Ó¦s¨ú¸ê®Æ®w¤¤ªº¼Æ¾Ú¡C¡@¡@

¹Ï13.3 ¼Æ¾Ú¦s¨ú­¶¤Wªº¼Æ¾Ú¦s¨ú³¡¥ó¡@

·í­n«Ø¥ß¤@­Ó¸ê®Æ®wÀ³¥Î®É¡A­º¥ý¦bµ¡Å餤¿ï¾Ü¤@­Ó¼Æ¾Ú¦s¨ú³¡¥ó¡AµM«á¬°¼Æ¾Ú¦s¨ú³¡¥ó³]©w¦³ÃöªºÄÝ©Ê¡A±Ô­z­n¦s¨úªº¸ê®Æ®w¡B¼Æ¾Úªí¥H¤Îªí¤¤ªº°O¿ýµ¥¡A¼Æ¾Ú¦s¨ú³¡¥ó¬°¼Æ¾Ú±±¨î³¡¥ó»P¼Æ¾Ú·½«Ø¥ß¤@±ø³q¹D¡C¼Æ¾Ú¦s¨ú³¡¥ó¦bµ{¦¡°õ¦æ®É¬O¤£¥i¨£ªº¡C¤Uªí¦C¥X¤F¼Æ¾Ú¦s¨ú­¶¤Wªº¼Æ¾Ú¦s¨ú³¡¥ó¥H¤Î¥¦­Ìªº¥D­n¥Î³~¡G¡@

ªí13.4 ¼Æ¾Ú¦s¨ú³¡¥ó

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w

³¡¥ó¼Ðñ ¡@ ¥D ­n ¥Î ³~

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@§@¬°¼Æ¾Ú¶°³¡¥óTTable¡BTQuery¡BStoredProc¸s¸s²Õ

TDataSource¡@¥ó»P¼Æ¾ÚÂsÄý¥óTDBGrid¡BTDBEdit¤§¶¡Âà°e¼Æ¾Ú

¡@ªº³q¹D¡C

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@¥¦¬O¦s¨úºÏºÐ¤W¸ê®Æ®wªíªº´C¤¶¡A¥¦³q¹LBDE¦s

TTable ¡@¨ú¸ê®Æ®wªí¤¤ªº¼Æ¾Ú¡ATTable¦A»PTDataSource

¡@¶i¦æ¡§¹ï¸Ü¡¨¡A¨Ï±o¼Æ¾ÚÂsÄý³¡¥ó¯à°÷¦³®Ä¦a±q

¡@TTable¤¤¦s¨ú¼Æ¾Ú¨Ã¯àÅã¥Ü©M½s¿è¨ä¤¤ªº¼Æ¾Ú¡C

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@¥¦§Q¥ÎSQL»y¨¥¦s¨úºÏºÐ¤W¸ê®Æ®wªí¤¤ªº¼Æ¾Ú¡A

TQuery ¡@¨Ã»PTDataSource¡§¹ï¸Ü¡¨¡A¹ê²{¼Æ¾ÚÂsÄý³¡¥ó

¡@¹ï¸ê®Æ®wªº¦s¨ú¡C

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

TStoredProc¡@¦bÀ³¥Îµ{¦¡¤¤¡A¥¦¥D­n¥Î¨Ó¦s¨ú»·ºÝ¦øªA¾¹¤¤ªº

¡@¦s¶J¹Lµ{

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

¡@·íÀ³¥Îµ{¦¡­nµn¤J¨ì¤@­Ó»·ºÝ¦øªA¾¹¤Wªº¸ê®Æ®w

TDatabase ¡@®É¡A¥i¥H¥Î¸Ó³¡¥ó¨Ó«Ø¥ßÀ³¥Îµ{¦¡»P¸ê®Æ®w¥Ã¤[

¡@©Êªº³s±µ¡C

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

TBatchMove¡@¥Î©ó´_¨î¸ê®Æ®wªíªºµ²ºc©Îªí¤¤ªº°O¿ý¡C

¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X¡X

TReport ¡@¥Î©ó«Ø¥ß¸ê®Æ®wªº¿é¥X³øªí¡C

¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¡@

        ­È±o«ü¥Xªº¬O¦bµ´¤j¦h¼Æ¸ê®Æ®wÀ³¥Î¤¤¡A¤@¯ë³£¬O¨Ï¥Î¼Æ¾Ú¶°³¡¥óTTable¡BTQuery©ÎTStoredProc»PºÏºÐ¤Wªº¸ê®Æ®w¶i¦æ³s±µ¡A¥ÎTDataSource³¡¥ó³s±µ¼Æ¾Ú±±¨î³¡¥ó©M¼Æ¾Ú¶°³¡¥ó¡A·íµM¥Î¤á¤]¥i¥H¦Û©w¸q¼Æ¾Ú¶°³¡¥ó¡A¥Î©ó¸ê®Æ®wÀ³¥Î·í¤¤¡A TTable ¡B TQuery ©MTStoredProc³¡¥ó¤¤³£¥]§t¤@­Ó¤£¥i¨£ªºTField«¬¦¡ªºª«¥óFields¡AFields¬O¤@­Ó¦ê²M³æ¡A¥¦¹ïÀ³©ó¸ê®Æ®wªí©Î¤@­Ó¬d¸ßµ²ªGªº¦C©ÎÄæ¦ì¡CFieldsª«¥ó¬O¦ñÀHµÛTTable¡B TQuery ©MTStoredproc³¡¥óªº¬¡°Êª¬ºA°ÊºA¦a«Ø¥ßªº¡A·í¸ê®Æ®wªí³QÃö³¬®É¡AFields ª«¥ó¤]ÀH¤§®ø¥¢¡A¥¦¦bµ{¦¡³]­p©Mµ{¦¡°õ¦æ¹Lµ{¤¤³£¬O¤£¥i¨£ªº¡C

·íµM¤]¥i¥H§Q¥ÎFields Editor«Ø¥ß¥Ã¤[©ÊªºFieldsª«¥ó¨ÑDelphiÀ³¥Îµ{¦¡¨Ï¥Î¡A §Ú­Ì±N¦b«á­±ªº¤º®e¤¤¸Ô²ÓÄÄ­z¡C

13.3.1.1 TTable³¡¥ó¡@

         §Q¥ÎTTable³¡¥óµ{¦¡³]­p¤H­û¬Æ¦Ü¥i¥H¤£»Ý­n½s¼g¥ô¦óµ{¦¡«K¥i¹ï¸ê®Æ®w¶i¦æ¦s¨ú¡A¦b¤@­ÓÀ³¥Îµ{¦¡µ¡Å餤©ñ¸m¤@­ÓTTable³¡¥óªº¹Lµ{¦p¤U¡G

¢°¡B¦b³¡¥ó¿ï¾ÜªO¤W¿ï¾ÜData Access­¶¡F

¢±¡B«ö¤@¤UTable¹Ï¥Ü¡F

¢²¡B¦bµ¡Å餺«ö¤@¤U·Æ¹«¡AÀò±o¤@­ÓTTable³¡¥ó¡F

¢³¡B¬°TTable³¡¥ó³]©w¦³ÃöªºÄÝ©Ê¡G

DatabaseNameÄÝ©Ê«ü©w­n¦s¨úªº¸ê®Æ®w©Ò¦bªº¸ô®|¦W¡A¸ô®|¦W¥i¥H¥Î§O¦W¨Óªí¥Ü¡C

TableNameÄÝ©Ê«ü©w­n¦s¨ú¸ê®Æ®w¤¤¨ãÅ骺¸ê®Æ®wªí¡C

ActiveÄݩʳ]©w¬°True®É¡Aªí¥Ü¥´¶}­n¦s¨úªº¸ê®Æ®wªí¡F³]©w¬°False®É¡A¼È®É ¤£¥´¶}­n¦s¨úªº¸ê®Æ®wªí¡C

        ¯Ê¬Ù±¡ªp¤U¡ATTtable³¡¥ó¤¤¥]§t¤F­n¦s¨úªº¸ê®Æ®wªí¤¤©Ò¦³ªºÄæ¦ì©M°O¿ý¡A ¥Î·Æ¹«³sÄò«ö¨â¤UTTable¹Ï¥Ü®É¡A·|¥X²{¤@­ÓÄæ¦ì½s¿è¾¹¡]Fields Editor¡^¡A¨Ï¥ÎFields Editor¥i¥H¹ïTTable³¡¥ó¤¤¥]§tªº¸ê®Æ®wªí¤¤ªºÄæ¦ìªºÅã¥Ü®æ¦¡µ¥Äݩʶi¦æ½s¿è¡A¨ãÅé¥i¥H±±¨î¡G

¡´ «Ø¥ß¤@­Ó¥Ã¤[©ÊªºÄæ¦ì²M³æ¡A¥]¬AÄæ¦ìªº¶¶§Ç¡AÄæ¦ìªº«¬¦¡µ¥¡A§Y¨ÏºÏºÐ¤W¹ê»Úªº¸ê®Æ®wªíªºªíµ²ºcµo¥Í¤F§ïÅÜ¡A§Ú­Ì«Ø¥ßªº³o­Ó¥Ã¤[©ÊªºÄæ¦ì²M³æ¤]¤£·|µo¥Í§ïÅÜ

¡´ ¬°¨C­ÓÄæ¦ì«ü©w¤@­Ó«K©ó¾\Ū©M¨Ï¥Îªº¦W¦r

¡´ «ü©wÄæ¦ìÅã¥Üªº¶¶§Ç

¡´ ¬°¨C­ÓÄæ¦ì«ü©w¤@­Ó¥Î©óÅã¥Üªº¦r¤¸¦ê

¡´ ¬°Äæ¦ì¼W¥[¦Xªk©ÊÀËÅç

¡´ ¬°¤FÅã¥Üªº»Ý­nÁÙ¥i¥H«Ø¥ß·sªºÄæ¦ì¡]¦p¥i­pºâªºÄæ¦ì¡^¨ãÅ骺¨Ï¥Î¤èªk¨£«á­±ªº¤º®e

13.3.1.2 TQuery³¡¥ó¡@

        TQuery³¡¥ó¬O§Ú­Ì¨Ï¥ÎSQL»y¨¥¶}µo¸ê®Æ®wÀ³¥Îµ{¦¡ªº¦³¤O¤u¨ã¡A¦]¬°¨Ï¥ÎSQL»y¨¥¡A§Ú­Ì¥i¥H«D±`¤è«KÆF¬¡¦a¹ï¤@­Ó©Î¦h­Ó¸ê®Æ®wªí¤¤ªº°O¿ý¶i¦æ¦s¨ú¡A©Ò¥H§Q¥ÎTQuery§Ú­Ì¥i¥H¬d¸ß¥»¦aªº¸ê®Æ®w¦pPà?aradox©MdBASE¸ê®Æ®w¨t²Î¤¤ªº¼Æ¾Ú¡A§Ú­ÌÁÙ¥i¥H¨Ï¥ÎTQuery³¡¥ó¹ï¤@­Ó»·¦aªº¸ê®Æ®wSQL¦øªA¾¹¶i¦æ¦s¨ú¡A«Ø¥ßClient/Server¼Ò¦¡ªºÀ³¥Îµ{¦¡¡C

¦b¤@­ÓÀ³¥Îµ{¦¡µ¡Å餤©ñ¸m¤@­ÓTQuery³¡¥óªº¹Lµ{¦p¤U¡G

¢°¡B¦b³¡¥ó¿ï¾ÜªO¤W¿ï¾ÜData Access­¶¡F

¢±¡B«ö¤@¤UQuery¹Ï¥Ü¡F

¢²¡B¦bµ¡Å餺«ö¤@¤U·Æ¹«¡AÀò±o¤@­ÓTQuery³¡¥ó¡F

¢³¡B¬°TQuery³¡¥ó³]©w¦³ÃöªºÄÝ©Ê¡G

DatabaseNameÄÝ©Ê«ü©w±N­n¦s¨úªº¸ê®Æ®wªº¸ô®|¦W¡C

        SQLÄÝ©Ê«ü©w¹ï¸ê®Æ®wªí¶i¦æ¦s¨úSQL»y¥y¡A¥¦¥i¥H¬O¤@±ø¬d¸ß»y¥y¤]¥i¥H¬O¤@±ø ­×§ï»y¥y©Î´¡¤J»y¥yµ¥¡C¦bª«¥óÂsÄý¾¹¤W¡A«ö¤@¤USQLÄݩʮɡA·|¥´¶}¤@­Ó¦r¤¸¦ê½s¿è¾¹¨Ñµ{¦¡³]­pªÌ¿é¤JSQL»y¥y¡C

        ¦b³oùØ­nª`·N¦bTQuery³¡¥ó¤¤¡A¤£¬O¥ÎTableName Äݩʨӫü©w­n¦s¨úªº¸ê®Æ®w¤¤ªº¸ê®Æ®wªí¡A¦Ó¬O¦bSQLÄݩʤ¤¡A³q¹LSQL»y¥y¨Ó«ü©w±N­n¦s¨úªº¸ê®Æ®wªí¡C

13.3.1.3 TDataSouece³¡¥ó¡@

        TDataSource³¡¥ó¬O³s±µ¼Æ¾Ú¶°³¡¥óTTable¡BTQuery¡B TStoredProc ©M¼Æ¾Ú±±¨î³¡¥óTDBGrid¡BTDBEditµ¥ªº¾ô¼Ù¡ATTable¡BTQuery¡BTStoredProc³¡¥ó³q¹LBDE¥i¥H¹ê²{»PºÏºÐ¤Wªº¸ê®Æ®w³s±µ§Y¦s¨ú¡A ¦ý¥¦­Ì¥»¨­¤£¯àÅã¥Ü¸ê®Æ®w¤¤ªº¼Æ¾Ú¸ê°T¡A ¦Ó¼Æ¾Ú±±¨î³¡¥ó¦pTDBGrid¡BTDBEditµ¥¯à°÷´£¨Ñ¥iµø¤Æªº¤¶­±¡AÅã¥Ü¸ê®Æ®w¤¤ªº¼Æ¾Ú¸ê°T¡A¦ý¥¦­Ì¤£¨ã³Æ¦s¨úºÏºÐ¸ê®Æ®wªº¯à¤O¡A¥¿¬OTDataSource±N³o¨âªÌ¦³¾÷¦aµ²¦X°_¨Ó¡A ¨Ï±o¥Î¤á¤~¯à¤¬°Ê¦a¹ï¸ê®Æ®w¤¤ªº¼Æ¾Ú¸ê°T¶i¦æ¬d¸ß¡B­×§ï¡B´¡¤J¡B¸Ñ°£µ¥¾Þ§@¡C

¦bÀ³¥Îµ{¦¡µ¡Å餤©ñ¸mTDataSource³¡¥óªº¹Lµ{¦p¤U¡G

¢°¡B¦b³¡¥ó¿ï¾ÜªO¤W¿ï¾ÜData Access­¶¡F

¢±¡B«ö¤@¤UDataSource¹Ï¥Ü¡F

¢²¡B¦bµ¡Å餺«ö¤@¤U·Æ¹«¡AÀò±o¤@­ÓTDataSource³¡¥ó¡F

¢³¡B¬°TDataSource³¡¥ó³]©w¦³ÃöªºÄÝ©Ê¡G

DatasetÄÝ©Ê«ü©w¤@­Ó¼Æ¾Ú¶°³¡¥ó¡A¥i¥H¬OTTable¡BTQuery©ÎTStoredProc³¡¥óªº ¦W¦r¡C¡@


«á¤@­¶
«e¤@­¶
¦^¥Ø¿ý
¦^­º­¶