«á¤@­¶
«e¤@­¶
¦^¥Ø¿ý
¦^­º­¶
²Ä¤Q¥|³¹¡@²³æ¸ê®Æ®wÀ³¥Îªº«Ø¥ß¤ÎMASTAPP¤¶²Ð¡]¤@¡^

        Delphi¤¤´O¤Jªº¸ê®Æ®wÀ³¥Î¶}µo¤u¨ã¦pDatabase Form Expert¨ã¦³«Ü±j¤jªº¥\¯à¡A§Ú­Ì¤£»Ý­n½s¼g¥ô¦óµ{¦¡¥N½X«K¥i¥H§Ö³t¦a«Ø¥ß¤@­Ó²³æªº¸ê®Æ®wÀ³¥Îµ{¦¡¡A¬Æ¦ÜÁÙ¯à«Ø¥ß°ò©ó¦h­Ó¸ê®Æ®wªíªº¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¡C

        ¥»³¹¥D­n¤¶²Ð¥ÎDelphi¶}µo²³æªº¸ê®Æ®wÀ³¥Îµ{¦¡ªº¤@¯ë¤èªk©M¨BÆJ¡A­º¥ýÅýŪªÌ¹ïDelphi±j«lªº¸ê®Æ®wÀ³¥Î¶}µo¤u¨ã¦³¤@­Óª½Æ[ªº¦L¶H¡AµM«á¦b¦¹°ò¦¤W¶i¦æ½ÆÂøªº¸ê®Æ®wÀ³¥Îµ{¦¡ªº³]­p¡A¥»³¹¥D­n¥]¬A¥H¤U¤º®e¡G

¡´ «Ø¥ß¸ê®Æ®wÀ³¥Îµ¡Åé

         ¥]¬A¥ÎDatabase Form Expert ©Î¤â¤u¤è¦¡«Ø¥ß²³æªºµL»Ý½s¼gµ{¦¡¥N½XªºÀ³¥Îµ{¦¡©ÎªÌ§Q¥Î¦h­Ó³¡¥ó¨Ã½s¼g¥\¯à½ÆÂøªºµ{¦¡¥N½X«Ø¥ß¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¡C

¡´ ¦bÀ³¥Îµ{¦¡¤¤±±¨îÄæ¦ì¦³ÃöªºÄÝ©Ê

         ´y­z«ç¼ËŪ¼g¸ê®Æ®wªí¤¤Äæ¦ìªº­È©M±±¨îÄæ¦ìªºÅã¥Ü®æ¦¡µ¥¡C

¡@

         ¥»³¹©Ò¤¶²Ðªº¨Ò¤l¤¤¥Î¨ìªºµ¡Åé¡B¸ê®Æ®wªí¥H¤Î¬ÛÃöªº¤å¥ó³£¬O¦b¸Ë³]Delphi®É¯Ê¬Ù¸Ë³]¦bC:\DELPHI\DEMOS\DB\MASTAPP¥Ø¿ý¤¤¡A¨Ã¥B¥Î§O¦WDBDEMOSªí¥Ü³o¤@¤l¥Ø¿ý¡C ¦b¥»³¹¨Ò¤l¤¤¡A°£¯S®íÁn©ú¥~¡A©Ò¦³ªºTTable©M TQuery ³¡¥óªº DatabaseName Äݩʳ£³]©w¬°DBDEMOS¡C

14.1 ²³æªº°ò©ó³æªíªº¾Ú®wÀ³¥Î¡@

         ¥ÎDecphi«Ø¥ßÅã¥Ü¤@­Ó¸ê®Æ®wªí¤¤ªº¤º®eªºÀ³¥Î«D±`²³æ©M¤è«K¡A¥u»Ý­n¤T­Ó³¡¥ó¡A¥u­n±N³o¤T­Ó³¡¥ó³q¹L¬ÛÃöªºÄݩʬۤ¬Ápô°_¨Ó¡A¤£»Ý­n½s¼g¥ô¦óµ{¦¡¥N½X«K¥i¥H¹ê²{¡C¨Ò¦p¡A¥Î¤á·Q¬d¬Ý¸ê®Æ®wªíCustomer.DB¤¤ªº¤º®e®É¡A¥i¥H«ö¤U­±¨BÆJ¨Ó¹ê²{¡G¡@

14.1.1 ¿ï¾Ü¬ÛÃöªº³¡¥ó¡G¡@

         ¿ï¾Ü¿ï¾ÜªíProject/New¶}©l¤@­Ó·s¤uµ{¡A¨Ã­×§ïForm1ªºCaptionÄݩʬ°CustomerFrom1¨Ã§âNameÄݩʳ]©w¬°CustomerForm1¡AµM«á±q³¡¥ó¿ï¾ÜªO¤WªºData Access ­¶¤W¿ï¨ú¤@­ÓDatasounce³¡¥ó©M¤@­ÓTable³¡¥ó©ñ¨ìµ¡Å骺¥ª¤W¨¤¡A¥¦­Ì¬O«D¥i¨£ªº³¡¥ó¡A ¦bµ¡Å餤§Ú­Ì¬Ý¨ìªº¥u¬O³¡¥óªº¹Ï¥Ü¡F±qData Control­¶¤W¿ï¨úDBGrid³¡¥ó©ñ¨ìµ¡Å餤«e¨â­Ó³¡¥óªº¤U­±¡C§¹¦¨³o¨Ç¤u§@¤§«á¡Aµ¡Åé¦p¹Ï14.1©Ò¥Ü¡C¡@¡@

¹Ï¦bCustomerFrom1µ¡Å餤©ñ¸m¤T­Ó³¡¥ó¡@

14.1.2 ³]©w³¡¥óªºÄÝ©Ê¡@

¬°¤F¨ÏTDBGrid³¡¥ó¯à°÷Åã¥Ü¸ê®Æ®wªíCustomer.DB¤¤ªº¥Î¤á¸ê°T¡A§Ú­Ì¥²¶·­×§ïµ¡Åé¤T­Ó³¡¥ó¬ÛÃöªºÄÝ©Ê¡A³o¨ÇÄݩʪº³]©w¦pªí14.1©Ò¥Ü¡C¡@

ªí14.1 CustomerFrom1µ¡Å餤¤T­Ó³¡¥óªºÄݩʳ]©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

ÄÝ ©Ê ÄÝ ©Ê ­È

¡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

DataSource1.AutoEdit False

DataSource1.DataSet Table1

Table1.DatabaseName DBDEMOS

Table1.TableName CUSTOMER.DB

Table1.Active True

DBGrid1.DataSource DataSource1

¢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¡@

        ³oùØ­nª`·Nªº¬O¡GDBDEMOS¬ODelphi¯Ê¬Ù¸Ë³]®ÉC:\Delphi\DEMO\DB\MASTAPP¥Ø¿ýªº§O¦W¡A¦Ó¥B¸ê®Æ®wªíCustomer.DB¦s¦b¸Ó¥Ø¿ý¤U¡A¥Î¤á¦b¨Ï¥Î³o¤@¨Ò¤l®É¡A ½Ðª`·N³o¨â¶µ³]©w³£¬O¥¿½Tªº¡C¥t¥~ Datasource1.Dataset¡ATable1.TableName©MDBGrid1.DatasourceÄݩʳ£¦³¤U©Ô¦¡¦C¥Ü¤è¶ô¤¹³\¥Î¤á±q¥i¯àªº­È²M³æ¤¤¿ï¾Ü¥¦­Ìªº­È¡A³o¼Ë¯à¤è«K§Ú­Ì¶i¦æÄݩʪº³]©w¡A¦Ó¥B¤£®e©ö¥X¿ù¡C

        Datasouuce1.AutoEditÄݩʳ]©w¬°False¬O¬°¤F¨¾¤î¥Î¤á­×§ï¸ê®Æ®wªí¤¤ªº¼Æ¾Ú¡A ¦b¤U­±ªº°Q½×¤¤§Ú­Ì±N¸Ô²Ó¦a¶i¦æ±Ô­z¡C

        Table1.Active³]©w¬°True®É,Delphi·|¥´¶}Table1.TableName©Ò«ü©wªº¸ê®Æ®wªí¡C¦pªG³o­Ó¸ê®Æ®wªí¤£¦s¦b¡]©Îªí¤¤¤°»ò¤]¨S¦³¡A §YªÅªí¡^¡A Delphi ·|¼u¥X¥X¿ù¸ê°T¨Ã¥BTable1.ActiveÅܦ¨False¡C·íTable1.Active³Q³]©w¦¨True¤§«á¡ATable1 ³¡¥óªº¤@¨ÇÄÝ©Ê´N¤£¯à¦A­×§ï¤F¡A¦pTable1.DatabaseName©MTable1.TablenameÄÝ©Ê¡C­Y­n­×§ï¥¦­Ì¡A ¥²¶·­º¥ý­n±NTable1.ActiveÄݩʳ]©w¬°False¡AµM«á¦A¶i¦æ­×§ï¡A§_«h¡ADelphi·|¼u¥X¿ù»~¸ê°T¡§Cannot perform this operation on an open database¡¨¡C·í¬Ý¨ì³o­Ó¿ù»~¸ê°T®É¡A¥u»Ý§âTable1.Active¸m¦¨False¡A§¹¦¨¬ÛÃöªº­×§ï«á¡A¦A§â Table1. Active Äݩʳ]©w¬°True¡C

        ·í§Ú­Ì§âDBGrid1.DataSourceªº­È³]©w¦¨DataSource1®É¡ADelphi·|§âCustomer.DB¤¤ªº¼Æ¾Ú¶ñ¥R¨ìDBGrid1³¡¥ó¤¤¡A¨Ã¥B¥i¥H¥ÎDBGrid1¤¤ªº¨÷¶b¨ÓÂsÄý¸ê®Æ®wªí¤¤ªº©Ò¦³°O¿ý¡C¡@

14.1.3 °õ¦æµ{¦¡¡@

        ¦sÀɤå¥ó¡A©R¦W¥N½X³æ¤¸¬°Cust.pas¡A©R¦W¤uµ{¦W¬°CustPRJ.DPR,µM«á«öF9½sĶ¨Ã°õ¦æµ{¦¡¡Cµ{¦¡°õ¦æ¤§«á¡A§Ú­Ì¥i¥H¨Ï¥Î¨÷¶b©ÎÁä½L²¾°ÊÁä¦bÄæ¦ì©M°O¿ý¶¡²¾°Ê¡C¦ý¤£¯à­×§ïªí¤¤ªº¼Æ¾Ú¡A¦]¬°Datasouc1.AutoEdit1Äݩʤw³Q³]©w¬°False¡C

        Custµ{¦¡¤¤ªº¤T­Ó³¡¥ó³£¦³¦U¦Ûªº¯S®í¥Î³~¡A¤T­Ó³¡¥óªº¬ÛÃöÄݩʦb¤º³¡¬Û¤¬Ápô²£¥Í³Ì²×ªºÀ³¥Îµ{¦¡¡CTTable³¡¥ó³s±µºÏºÐ¤Wªº¹ê»Ú¸ê®Æ®wªí©MÀ³¥Îµ{¦¡¤¤¨ä¥L³¡¥óªº³q¹D¡CTTable³¡¥ó¨ã¦³¥´¶}©MÃö³¬¡BŪ¨ú¡B§ó·s¥H¤Î¨ä¥L³B²zºÏºÐ¸ê®Æ®w¤å¥óªº¤èªk¡C

        TDatasource³¡¥ó¬O³s±µTTable³¡¥ó©M¼Æ¾ÚÂsÄý³¡¥ó¦pTDBGrid³¡¥óªº¾ô¼Ù¡C TDBGrid³¡¥ó¥Î©óÅã¥Ü¸ê®Æ®wªí¤¤ªº¼Æ¾Ú¸ê°T¡A¥¦¬°À³¥Îµ{¦¡´£¨Ñ¤@­Óª½Æ[ªº¤¶­±¡C¹Ï14.2ÄÄ­z¤F³o¤T­Ó³¡¥ó¤§¶¡ªºÃö«Y¡C¡@

Custµ{¦¡¤¤¤T­Ó³¡¥ó¤§¶¡ªº¤º³¡Ãö«Y¡@

        TDBGrid ³¡¥óªº©_§®¤§³B¦b©ó¥¦ª¾¹D¦p¦ó¥hÀò¨ú¸ê®Æ®wªí¤¤ªº¤U¤@±ø©Î«e¤@±ø°O¿ý¡A§Ú­Ì¨Ï¥Î¨÷¶b©Î¤è¦VÁä«K¥i¥H§¹¦¨³o¶µ¥ô°È¡CTDBGrid³¡¥ó¤£ª¾¹D¦p¦ó¼W¥[¡B ¸Ñ°£©M­×§ï°O¿ý¡C¦pªG·QÅý Cust µ{¦¡¯à°÷­×§ï¸ê®Æ®wªí¤¤ªº°O¿ý¡A ¥u­n§â Datasource1 ³¡¥óªºAutoEditÄݩʳ]©w¦¨True ¡A ¨Ã­«·s½sĶ©M°õ¦æµ{¦¡´N¥i¥H¹F¨ì¥Øªº¡C ¨Ï¥Î¤è¦VÁä¡A §âDBGridªº°ª¥ú«×±ø©w¦ì¨ì¬Y¤@­ÓÄæ¦ì¤W¡AµM«áÁä¤J·s­È¡A¸ÓÄæ¦ì¤¤ªº­È±N³QÁä¤Jªº·s­È©Ò¨ú¥N¡A¨Ã¥B·í²¾°Ê¨ì¥t¤@±ø°O¿ý®É¡A°·¤Jªº¸ê°T·|¦Û°Ê¼g¤J¸ê®Æ®wªí¤¤¡C¦pªG·Q©ñ±ó©Ò°µªº§ï°Ê¡A¥u»Ý¦bÂ÷¶}¸ÓÄæ¦ì«e«ö¤@¤UEscapeÁä¡C

        ¦pªG·Q¦bªí¤¤¼W¥[·s°O¿ý¡A¥i¥H§â°ª¥ú«×±ø²¾¨ìºô®æ©³ºÝªºªÅ¥Õ°O¿ý¤W¨Ã¿é¤J·s°O¿ýªº¦³ÃöÄæ¦ì­È¡C¤]¥i¥H¦b¥Î¤á«ü©wªº¬Y¤@±ø°O¿ýªº«á­±´¡¤J¤@±ø·s°O¿ý¡A¥u­n§â°ª¥ú«×±ø©w¦ì¨ì«ü©wªº°O¿ý¤W¡A«öInsÁä¡A¨Ï¥i¥H¦b¸Ó°O¿ýªº«á­±´¡¤J·s°O¿ý¡C

        ¸Ñ°£¬Y¤@±ø°O¿ý®É¡A§â°ª¥ú«×±ø©w¦ì¦b·Q¸Ñ°£ªº°O¿ýªº¥ô¦óÄæ¦ì¤W¡A«öCtrl+ delÁä,³o®É·|¥X²{«OÅ@¸ê°T¡A§Ú­Ì¥i¥H½T»{¬O§_¯uªº·Q¸Ñ°£¸Ó¶µ°O¿ý¡C

        TDBGrid¬°¥Î¤á´£¨Ñ¤F¸û§¹³Æªº¥\¯à¡A¥Î©ó±±¨î¬O§_½s¿è¡B¼W¥[©Î¸Ñ°£°O¿ý¡C ­Y·Q¸T¤î¹ï¸ê®Æ®wªí§@¥ô¦ó­×§ï¡A³]©wTDBGrid³¡¥óªºReadonlyÄݩʬ° True ¡A ¨Ã³]©w Option.dgEDiting¬°False(³o±N¬°§Ú­Ì´£¨Ñ¤@­Ó°ßŪªº¸ê®Æ®wªíÂsÄý¾¹¦Ó¤£¬O¸ê®Æ®w½s¿è¾¹¡A¦ý¥¦Áô§tµÛ¼W¥[¡B½s¿è©M¸Ñ°£°O¿ýªº¯à¤O)¡CTDBGrid³¡¥óªº³o¨ÇÄÝ©Ê©MOptionÄݩʨ䥦¿ï¶µªº¦UºØ¤£¦P¸s¸s²Õ¦X¥i¥HÅý§Ú­Ì«Ü¤è«K¦a¹ï¸ê®Æ®wªí¶i¦æ¦³®ÄªºÂsÄý¡B½s¿èµ¥¾Þ§@¡C

        ¦pªG§Ú­Ì¸g±`¨Ï¥Î¹³¹q¤lªí®æ¨º¼Ëªº¤¶­±¨ÓÅã¥Ü©M½s¿è¼Æ¾Ú°O¿ý¡ATDBGrid ³¡¥ó«K¬O¤@­Ó«Ü¤è«Kªº¤u¨ã¡A¦ý¨º¨Ã¤£¬O³Ì¤Í¦nªº¥Î¤á¤¶­±¡A¦pªG·Q¾Ö¦³§óÀu¬ü§óª½Æ[ªº¤¶­±¡A§Ú­ÌÁÙ¥i¥H¨Ï¥Î³æ¿Wªº¼Æ¾ÚÂsÄý³¡¥ó¨ÓÅã¥Ü¸ê®Æ®wªí¤¤¦U­ÓÄæ¦ìªº­È¡A¨Ã§Q¥ÎTDBNavigator³¡¥ó±±¨î¹ï¸ê®Æ®wªíªº¦s¨ú¡C¡@

14.2 §Q¥ÎTDBNavigator³¡¥ó«Ø¥ß¦s¨úµ{¦¡¡@

          §Ú­Ì¥i¥H§ï¶i¤@¤UCustµ{¦¡¥H«K¥¦¤@¦¸¥u¦b¹ï¸Ü¤è¶ô¤¤Åã¥Ü¤@­Ó¥Î¤áªº°O¿ý¸ê°T¡A¨Ã¥Î¤@­ÓTDBNavigator³¡¥ó±±¨î¹ï°O¿ý¦s¨ú¡X¡X¤¹³\§Ú­Ì¿ï¾Ü¤@­Ó°O¿ý¨ÓÅã¥Ü©Î½s¿è¥H¤Î¼W¥[©M¸Ñ°£°O¿ý¡C§¹¦¨ªºÀ³¥Îµ¡Åé¡C

¼W±jªºCustµ{¦¡

14.2.1 «Ø¥ßÀ³¥Îµ{¦¡µ¡Åé¡@

        §Ú­Ì¥i¥H«D±`¨³³t¦a«Ø¥ß°_¨Ó¡A¦]¬°¨ì¥Ø«e¬°¤î§Ú­Ì¹ï«Ø¥ßµ¡Å骺¤èªk¤w¸g¤ñ¸û¼ô±x¡A§Ú­Ì­º¥ý§â©Ò¦³ªº³¡¥ó³£©ñ¨ìµ¡Å餤¡AµM«á¦A³]©w¥¦­ÌªºÄÝ©Ê¡C

        ¶}©l¤@­Ó·s¤uµ{¡A³]©wµ¡ÅéForm1ªºName Äݩʬ° Customerform2 ¡A Caption Äݩʬ°         CustomerForm2¡CµM«á±q³¡¥ó¿ï¾ÜªO¤WªºData Access­¶¤W¿ï¨ú¤@­ÓDatasource³¡¥ó©M¤@­ÓTable³¡¥ó©ñ¦bµ¡Å骺¥k¤W¨¤¡C¦A±qData Controls­¶¤W¿ï¨úDBNatvigator³¡¥ó©ñ¦bµ¡Å骺¥ª¤W¨¤¡C

        µ¡Å餤¨ä¾lªº³¡¥ó¦p¹Ï14.3©Ò¥Ü¡C¥¦­Ì¬OTDBEdit©MTLabel³¡¥ó¡A«ö¹Ï14.3 ©Ò¥Ü«Ø¥ß¨Ã¥¬¸m³¡¥ó¡A¤À§O©R¦WDBEdit³¡¥ó¬°EditCustno¡B Editcompany ¡B EditAddr1 ¡BEditAddr2¡BEditCity¡BEditState¡BEditZip¡BEditCountry¡BEditPhone ¡BEditFAX¡BEditTaxRate¡BEditContact¡C

        ²{¦b§Ú­Ì¨Ó³s±µTTable³¡¥ó©M TDataSource ³¡¥ó¡A µM«á³s±µ©Ò¦³ªº¼Æ¾ÚÂsÄý³¡¥ó©MDataSource³¡¥ó¡C³]©wTBNavigator³¡¥ó©MTDBEdit³¡¥óªºÄÝ©Ê¡A¥¦­ÌªºDataSourceÄݩʳ£³]©w¬°DataSouce1¡C§Ú­Ì³Ì«á­n°µªº¨Æ¬O³s±µµ¡Å餤¦U­ÓTDBEdit ³¡¥ó©M¥¦­Ì¦b¸ê®Æ®wªí¤¤¹ïÀ³ªºÄæ¦ì¦W¡A³q¹L³]©wTDBEdit ³¡¥óªº DataField Äݩʨӧ¹¦¨¡C ¨Ò¦p­n³s±µ©R¦W¬°EditCustNoªºTDBEdit³¡¥ó©M¸ê®Æ®wªí¤¤ªºCustNoÄæ¦ì¡A¨ãÅé¨BÆJ¦p¤U¡G

Æ¡¿ï¤¤µ¡Å餤ªºEditCustNo³¡¥ó¡C

Æ¢¦bObject Inspectorµ¡Å餤¡A«ö¤@¤UDataFieldÄÝ©Ê¥kÃ䪺½bÀY¡C

Æ£±q¤U©Ô²M³æ¤¤¿ï¤¤CustNoÄæ¦ì¦W¡C

          ¹ïµ¡Å餤ªº¨ä¥LTDBEdit³¡¥ó°õ¦æ¥H¤W¾Þ§@³s±µ¨ì¨ä¹ïÀ³ªºÄæ¦ì¡AµM«á¦sÀɤå¥ó¡C ©R¦W¥N½X³æ¤¸¦W¬°Cust2.pas¡A©R¦W¤uµ{¦W¬°Cusprj2.DPR¡C¡@

14.2.2 ¨Ï¥ÎTDBNavigator³¡¥ó²¾°Ê°O¿ý«ü¼Ð¡@

        ¤W­zµ{¦¡°õ¦æ¤§«á¡A¦b¼Æ¾ÚÂsÄý³¡¥ó¤¤·|Åã¥Ü¸ê®Æ®wªí¤¤ªº²Ä¤@±ø°O¿ý¡C§Q¥ÎTab Áä¥i¥H¦bÄæ¦ì¤§¶¡²¾°Ê¡A¦ý¬O¤£¯à½s¿èÄæ¦ì¡C¦]¬°§Ú­Ì¬°¤F¨¾¤î·N¥~­×§ï¡A³]©w¤FTable1ªºAutoEditÄݩʭȬ°False¡C¦pªG·Q¹ï¸ê®Æ®wªí¤¤ªº°O¿ý¶i¦æ½s¿è¡B ´¡¤J©M¸Ñ°£¾Þ§@©ÎªÌ·QÅã¥Ü¸ê®Æ®wªí¤¤¥t¤@±ø°O¿ý¡A »Ý­n«ö TDBNvigator ³¡¥ó¤W³o¨Ç¥\¯à©Ò¹ïÀ³ªº¥\¯à«ö¶s¡CTDBNavigator³¡¥ó¤Wªº«ö¶s©M¥¦­Ìªº¥\¯à¦p¹Ï14.4©Ò¥Ü¡C

TDBNavigator¤¤ªº«ö¶s¡@

        TDBNavigator³¡¥óªºµ´¤j¦h¼Æ¥\¯à³£¥i¥H®Ú¾Ú¨ä«ö¶sªº¹Ï¥Ü¯à°÷«Ü®e©ö¦aÃѧO¥X¨Ó¡A¦Ó¥BTDBNavigator³¡¥ó¥»¨­¯à·Pª¾¨ì«Ü¦h¨Æ±¡¡A¦p¥Ø«e«ü¼Ð¬O§_¦b¸ê®Æ®wªíªº¶}ÀY©Î§À³¡¡C¦pªG¥Î¤á¥¿¦b¬d¬Ý¸ê®Æ®wªí¤¤ªº³Ì«á¤@­Ó°O¿ý¡ANext©MLast«ö¶s±N·|ÅܦǦ¨¬°«D¬¡°Êª¬ºA¡C¦P¼Ë¡A ¦pªG¥Î¤á¥Ø«e¥¿¦bÂsÄý¸ê®Æ®wªí¤¤ªº²Ä¤@±ø°O¿ý¡A TDBNavigator ¤Wªº First ©MPrevious«ö¶s·|ÅܦǦӦ¨¬°«D¬¡°Êª¬ºA¡C¦³Ãö¦U­Ó«ö¶sªº§@¥Îªº§ó¸Ô²Ó±Ô­z½Ð¬d¬Ý³s½u»²§U±Ô­z¡C

        ¦pªG¥Î¤á·Q­×§ï¥Ø«eªº°O¿ý¡A«ö¤@¤UTDBNavigator³¡¥óªºEdit«ö¶s¡AµM«á§¹¦¨»Ý­n°µªº­×§ï¡A¦b°µ§¹­×§ï¤§«á¡A«ö¤@¤UPost«ö¶s¥H«K±N§@ªº­×§ï¼g¤J¹ê»Úªº¸ê®Æ®wªí¤¤¡]§ó·s¹ê»Úªº¸ê®Æ®wªí¤¤ªº°O¿ý¦b¸ê®Æ®w³N»y¤¤¥s§@¡§§ë±H¡¨°O¿ý§YPostT¡^¡C ¦pªG·Q¨ú®ø©Ò°µªº­×§ï¡A«ö¤@¤UCancel«ö¶s¡CCancel«ö¶s¥u¨ú®ø¦Û±q¤W¤@¦¸©¹¸ê®Æ®wªí¤¤§ë±H°O¿ý¥H¨Ó¹ï°O¿ý©Ò°µªº­×§ï¡C¨Ò¦p¡A¦pªG¥Î¤á´¿­×§ï¤FCustNoÄæ¦ì¨Ã«ö¤@¤U¤FPost«ö¶s§ë±H¤F­×§ï¡AµM«á¦A­×§ïCompanyÄæ¦ì¨Ã«öCancel¡A¨º»ò¥u¦³¹ïCompany©Ò°µªº­×§ï±N·|³Q¨ú®ø¡C¤]´N¬O»¡¡A¤@¥¹­×§ï³Q¼g¤J¤F¸ê®Æ®wªí¤¤¡A¦A«öCancle«ö¶s¬OµLªk¨ú®ø¹ï°O¿ýªº­×§ïªº¡A­n·Q«ì´_¨ì¥H«eªºª¬ºA¡A¥Î¤á¥²¶·­n­«·s½s¿è­×§ï°O¿ý¡C­È±oª`·Nªº¬O¡A·í¥Î¤á­×§ï¤F¥Ø«eªº°O¿ý¡A¨Ã²¾°Ê¨ì¨ä¥L°O¿ý®É¡ATDBNavigaator³¡¥ó·|¦Û°Ê¦a§ë±H¥Î¤á¹ï°O¿ýªº­×§ï¡C ¨Ò¦p¡G¦pªG§Ú­Ì­×§ï¤F°O¿ýªºCompanyÄæ¦ì¡A¨Ã¨S¦³«öPost«ö¶s¥H§ó·sªí¤¤ªº°O¿ý¡A ¦Ó¬O²¾°Ê¨ì¤U¤@±ø°O¿ý¡A³o®É¥Î¤á¹ï°O¿ýªº­×§ï¤]·|¦Û°Ê¦a³Q¼g¤J¸ê®Æ®wªí¤¤¡C¡@

14.2.3 ©w¨îTDBNavigator³¡¥ó¡@

        TDBNavigator³¡¥ó¤¤ªº«ö¶s¹ï§Ú­Ì¶}µo¤H­û¨Ó»¡¬O«Ü¤è«Kªº¡A¦ý¹ï©óµ{¦¡ªº³Ì²×¥Î¤á¨Ó»¡¤£¤@©w¨º»ò¤@¥ØÁAµM¡C¬°¤F»²§U±Ô­z³Ì²×¥Î¤á©Îªì¯Å¥Î¤á§ó¤è«K¦³®Ä¦a¨Ï¥ÎTDBNavigator³¡¥ó¡A§Ú­Ì¥i¥H³]©wTDBNavigator³¡¥óªºShowHintÄݩʬ°True¡A³o¼Ë·í·Æ¹«¹C¼Ð°±¯d¦bTDBNavigator³¡¥ó¤Wªº¬Y¤@­Ó«ö¶s¤W¶W¹L¤j¬ù¢°¬íÄÁ¡A¦b¿Ã¹õ¤W«K·|¥X²{¸Ó«ö¶sªº´£¥Ü¸ê°T¡C¦pªG§Ú­Ì¤£·Q¨Ï¥ÎTDBNavigator³¡¥ó¥»¨­´O¤Jªº´£¥Ü¸ê°T¡A§Ú­ÌÁÙ¥i¥H³]©wTDBNavigtor³¡¥óªºHintsÄÝ©Ê¡A¬°¨C­Ó«ö¶s«ü©w¯S©wªº´£¥Ü¸ê°T¡A¥H»²§U±Ô­z¥Î¤á¨Ï¥ÎTDBNavigator³¡¥ó¡C

        TDBNavigator³¡¥ó¤¤¦³¦h­Ó¥\¯à«ö¶s¡A¦ý¨Ã¤£¬O©Ò¦³ªº«ö¶s¹ï¨C¤@­Ó¸ê®Æ®wÀ³¥Îµ{¦¡³£¬O»Ý­nªº¡A¯S§O¬O¨º¨Ç¤£¤¹³\­×§ïªí¤¤ªº¼Æ¾Ú¡A©Î­×§ï¥u¬O¦b«ÜÄY®æªº±±¨î¤U¶i¦æªº¸ê®Æ®wÀ³¥Îµ{¦¡¡C§Ú­Ì¥i¥H³q¹L³]©wTDBNavigator³¡¥óªº VisibleButtons ÄݩʨӽT©w­n¦bTDBNavigator¤¤Åã¥Ü­þ¨Ç«ö¶s¨BÅã¥Ü­þ¨Ç«ö¶s¡C¨Ò¦p¡A¦pªG§Ú­Ì¤£¤¹³\¥Î¤á­×§ïªí¤¤ªº°O¿ý¡A§Ú­Ì´N¤£»Ý­nAdd¡BDelete¡BPost¡BCancel ©Î Refresh «ö¶s¡A §Ú­Ì³]©w³o¨Ç«ö¶sªºVisibleButtonsÄݩʬ°False¡A³o¼Ë¦bTDBNavigator³¡¥ó¤¤±N¤£·|¥X²{³o¨Ç«ö¶s¡C

        TDBNavigator³¡¥óªºConfirmDeleteÄÝ©Ê©MDelete «ö¶s°t¦X¨Ï¥Î¹ï¥Î¤á¸Ñ°£¸ê®Æ®wªí¤¤ªº°O¿ý¬O«D±`¦³¥Îªº¡A·íConfirmDeleteÄݩʳ]©w¬° True ¡]¯Ê¬Ù³]©w¡^¡A ·í¥Î¤á«ö¤@¤UDelete«ö¶s¸Õ¹Ï¸Ñ°£¥Ø«e°O¿ý®É¡ADelphi·|¼u¥X¤@­Ó½T»{®Ø¡A­n¥Î¤á½T»{¬O§_¯uªº·Q¸Ñ°£¥Ø«e°O¿ý¡C³o¼Ë¡A¦b¥Î¤á¶i¦æ¸Ñ°£°O¿ýªº¾Þ§@®É¡A·|§ó¦w¥þ¤@¨Ç¡C¦pªG¥Î¤á¤£§Æ±æ¦b«ö¤UDelete«ö¶s®É¥X²{½T»{®Ø¡A¥u­n§âConfirmDelete³]©w¬°False´N¥i¥H¤F¡C

        ÁÙ¦³¤@¨ÇÄÝ©Ê¥i¥H¥Î¨Ó©w¨îTDBNavigator³¡¥óªº¥~Æ[©M©Ê¯à¡A¦³Ãö³o¤è­±ªº¸Ô²Ó¸ê°T½Ð°Ñ¬Ý³s½u»²§U±Ô­z¡C

14.3 «Ø¥ß¥D­n¡X¡X©ú²Ó¸ê®Æ®wÀ³¥Î¡@

        §Ú­Ì«e­±¦b¤¶²Ðªº°ò©ó³æ­Ó¸ê®Æ®wªíªº¸ê®Æ®wÀ³¥Îµ{¦¡¥u¯à¹ï¸ê®Æ®wªí¶i¦æ²³æªººÞ²z¡A¤j¦h¼Æ¥u¥Î¨ÓÂsÄý³æ­Ó¸ê®Æ®wªí¤¤ªº°O¿ý¸ê°T¡A¦pªG§Ú­Ì·QÂsÄý¦h­Ó¬ÛÃöªº¸ê®Æ®wªí¤¤ªº°O¿ý¸ê°T¡A´N¥²¶·­n«Ø¥ß¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¡C

        ¦b¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¤¤¡A¤@­Ó¸ê®Æ®wªí§@¬°¥D­nªí¡A¨ä¤¤¦s©ñµÛºî¦X¸ê°T¡A¨ä¥Lªº¸ê®Æ®wªí©M¥D­n¸ê®Æ®wªí¬ÛÃöÁp¡A¥¦­Ì·í¤¤¦s©ñµÛ§ó¸Ô²Óªº¸ê°T¡C¨Ò¦p¡A·í¸ê®Æ®wªíCustomer.DB§@¬°¥Dªí¡A¥¦¥]§tµÛ¥Î¤áªººî¦X¸ê°T¦p½s¸¹¡B©m¦W¡B ©Ò¦b¤½¥qªº¼Ðñµ¥µ¥¡C¦Ó¸ê®Æ®wªíOrders.DB¤¤¥]§tµÛ¨C­Ó¥Î¤áªº­q³f³æªº¸Ô²Ó¸ê°T¡A¦p­q³æ¸¹¡B µo³f¤é´Á¡B°_¹B¤é´Á¡Bµo³f¥Øªº¦aµ¥¸ê°T¡A³o¼Ë·í¦bCustomer.DBªí¤¤¬d¬Ý¬Y¤@¦ì¥Î¤á®É¡A §Q¥Î¨ä¤¤ªºÄæ¦ìCustNo»POrders.DBªíµo¥ÍÁpô¡A¦Û°Ê¦a±qOrders.DBªí¤¤À˯Á¥X³o¦ì¥Î¤á´¿¸gµo¨Óªº©Ò¦³­q³f³æªº¸Ô²Ó¸ê°T¡C¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÅé²{¤FÃö«Y¸ê®Æ®wªº¯SÂI¡A§Y¿W¥ßªº¸ê®Æ®wªí¤§¶¡°ò©ó¥¦­Ì¦@¦PªºÄæ¦ì¦Óµo¥ÍÁpô¡C¦b³oùØCustomer.DB©MOrders.DB¾Ö¦³¤@­Ó¦@¦PªºÄæ¦ìCustNo¡C

14.3.1 ¤@¹ï¦hÃö«Yªº¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¡@

        ¥D­n©M©ú²Ó¸ê®Æ®wªí¤§¶¡¦s¦b¤@¹ï¦hªºÃö«Y¡A·N«ä¬O»¡¹ï©ó¥Dªí¤¤ªº¤@±ø°O¿ý¡A¦b©ú²Óªí¤¤¦³¦h±ø°O¿ý»P¤§¹ïÀ³¡C¨Ò¦p¡A«Ø¥ß¤@­Ó¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Îµ{¦¡¡A¨ä¥]¬A¨â­ÓªíCustomer.DB©MOrders.DB¡A¥¦­Ì¤À§O§@¬°¥Dªí©M©ú²Óªí¡A«Ø¥ß¦nªºÀ³¥Î¦p¹Ï14.5©Ò¥Ü¡Aµ¡Å餤¦U³¡¥óªºÄݩʳ]©w¡@¡@

ªí14.2 ¥D­n¡X¡X©ú²Ó«¬¸ê®Æ®wÀ³¥Î¤¤¦U³¡¥óªºÄÝ©Ê

¢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

³¡ ¥ó ÄÝ ©Ê ÄÝ ©Ê ­È ª` ÄÀ

¡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

Table1 Active True

(¥Dªí) DatabaseName DBDEMOS

TableName CUSTOMER.DB

¡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

DataSource1 DataSet Table1

AutoEdit False

¡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

Table2 Active True

(©ú²Óªí) DatabaseName DBDEMOS

TableName ORDERS.DB

IndexFieldNames CUSTNO «ü©wÄæ¦ìCUSTNO§@¬°

Table2¤¤ªº¯Á¤ÞÄæ¦ì

MasterField CUSTNO «ü©w»P¥Dªíµo¥ÍÁpô

ªºÄæ¦ì

MasterSource DataSource1 ±Ô­z»P¥Dªí¬Û³s±µªº

¼Æ¾Ú·½§YDataSource

¡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

DataSource2 DataSet Table2

AutoEdit False

¡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

DBGrid1 DataSource DataSource1

(¹ïÀ³¥Dªí)

¡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

DBGrid2 DataSource DataSource2

(¹ïÀ³©ú²Óªí)

TableName ORDERS.DB

¡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

DBNavigator1 DataSource DataSource1

¢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¡@

        ¤@¹ï¦hÃö«Y¬O«D±`´¶¹MªºÃö«Y¡C§Y«K¬O²³æªº¦W¦r/ ¦ì§}¸ê®Æ®w³£¦³¤@¹ï¦hªºÃö«Y¡A¦]¬°¤@­Ó¤H¥i¯à¤£¤î¤@­Ó¦ì§}¡G®a®x¦ì§}¡B¤u§@¦ì§}¡BÁÙ¥i¯à¦³§O¹Ö¦ì§}¡C¦b¥»¨Ò¤¤¡A¤½¥qªº¤@­Ó¥Î¤á±`±`¦³¦h­Ó­q³f³æ¡A·í§Ú­Ì«ö¤@¤UDBNavigator1¤¤ªº¦V«e¡B¦V«á«ö¶s®É¡A·|²¾°ÊDBGrid1¤¤ªº°O¿ý«ü¼Ð¡A¦Ó¦bDBGrid2¤¤·|¦Û°ÊÅã¥Ü»PDBGridl ¤¤¥Ø«e°O¿ý¬ÛÃöªº¦h±ø°O¿ý¡A§YÅã¥Ü¤@­Ó¥Î¤áªº¸ê°T®É¡A¦P®É·|Åã¥Ü¸Ó¥Î¤áªº©Ò¦³­q³f³æªº¸Ô²Ó¸ê°T¡C¡@

14.3.2 ¤@¹ï¦h¡X¡X¦hÃö«Yªº¸ê®Æ®wÀ³¥Î¡@

        «e­±§Ú­Ì¤¶²Ð¤F°ò©ó¨â­Óªíªº¤@¹ï¦hÃö«YªºÀ³¥Î¡A¤U­±§Ú­Ì¤¶²Ð«ç¼Ë«Ø¥ß¤@­Ó±q¤T­Óªí¤¤ÂsÄý¼Æ¾Ú°O¿ýªº¤@¹ï¦hÃö«YªºÀ³¥Î¡C

         ¨Ò¦p¡G¤@­Ó¥Î¤á¤]³\¦³¦h±i­q³f³æ¡A¦Ó¨C¤@±i­q³f³æ¤¤¦³¦h­Ó­q³f¶µ¥Ø¡A³o¼Ë§Ú­Ì¦bCustomer.DBªí©MOrders.DBªí¤§¶¡«Ø¥ß¤@­Ó¥D­n¡X¡X©ú²Ó«¬Ãö«Y¡A¦P®É¦borders.DB ªí©MItems.DBªí¤§¶¡«Ø¥ß¤@­Ó¥D­n¡X¡X©ú²Ó«¬Ãö«Y¡C¡@

µ¡Å餤¦U³¡¥óªºÄݩʦpªí14.3©Ò¥Ü¡@

ªí14.3 ¤@¹ï¦h¡X¡X¦hÃö«YªºÀ³¥Î¤¤¦U³¡¥óªºÄÝ©Ê

¢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

³¡ ¥ó ÄÝ ©Ê ÄÝ ©Ê ­È ª` ÄÀ

¡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

Active True

Table1 DatabaseName DBDEMOS

TableName CUSTOMER.DB

¡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

DataSource1 DataSet Table1

AutoEdit False

¡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

Active True

DatabaseName DBDEMOS

Table2 TableName ORDERS.DB

IndexFieldNames CUSTNO

MasterField CUSTNO

MasterSource DataSource1

¡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

DataSource2 DataSet Table2

AutoEdit False

¡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

Active True

DatabaseName DBDEMOS

Table3 TableName ORDERS.DB

IndexFieldNames ORDERNO

MasterField ORDERNO

MasterSource DataSource2

¡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

DataSource3 DataSet Table3

AutoEdit False

¡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

DBGrid1 DataSource DataSource3

¡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

DBNavigator1 DataSource DataSource1

¢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¡@

        µ¡Å餤¨ä¾lªº³¡¥ó³£¬OTDBEdit©MTLabel³¡¥ó¡A¥¦­Ì¥Î©óÅã¥ÜCustomer.DB¤¤ªºÄæ¦ì­È©MOrder.DB¤¤ªºÄæ¦ì­È¡C¦b¸Ó¨Ò¤l¤¤¡AÁ`¦@³s±µ¤F¤T­Óªí¡A Customer. DB ªí¬O¥D­nªí¡AOrders.DBªí¦bµ¡Å餤°_¨ì¤FÂù­«§@¥Î¡A¥¦¬J¬OCustomer.Dbªíªº©ú²Óªí¡A¦P®É¤S¬OItems.DBªíªº¥D­nªí¡AItems.DBªí¬OOrders.DBªíªº©ú²Óªí¡C¡@

14.4 Äæ¦ìª«¥óªº¨Ï¥Î¡@

          Ttable©MTQuery³¡¥ó¤¤¦³¤@­ÓTField«¬¦¡ªºÄÝ©ÊFiedls¡AFields¬OTField«¬¦¡ªºª«¥óªº²M³æ¡ATFieldª«¥ó²M³æ¬ODelphi¸ê®Æ®w¤¤¸ûÃø¥H²z¸Ñªº¤@­Óª«¥ó¡A¥¦¬O TTable ³¡¥ó©MTQuary³¡¥óªº¤@³¡¤À¡A¥¦­Ì¬O¤£¯à°÷¿ï¾Ü¨ìµ¡Å餤ªº¿W¥ßªº³¡¥ó¡A¦Ó¥BµL½×¬O¦b³]­p¶¥¬qÁÙ¬O¦bµ{¦¡°õ¦æ¹Lµ{¤¤¡A¥¦­Ì³£¨S¦³¥i¨£ªº¹Ï¹³¡C§Y¨Ï¨ìObject Inspectorµ¡¤¤¹î¬Ý¥¦­Ì¤]«Ü§xÃø¡C

        Tfieldª«¥ó¬O¦b¥´¶}ºÏºÐ¤Wªº¸ê®Æ®wªí®É°ÊºA²£¥Íªº¡A¨Ã¦b¸ê®Æ®wªí³QÃö³¬®É¦Û°Ê®ø¥¢¡ATFieldª«¥ó¥i¥H±±¨îªí¤¤ªº¨C¤@¦C¬O§_¦b¼Æ¾ÚÂsÄý³¡¥ó¤¤Åã¥Ü¥H¤Î¥H¦óºØ®æ¦¡Åã¥Üµ¥µ¥¡C³q¹LÄæ¦ì½s¿è¾¹(Fields Editor)§Ú­Ì¥i¥H«Ø¥ß¥Ã¤[©ÊªºTField ª«¥ó²M³æ¥N´À°ÊºAªºTfieldª«¥ó²M³æ¨ÑDelphiÀ³¥Îµ{¦¡¨Ï¥Î¡A³q¹LFields Editor«Ø¥ßªº¥Ã¤[©ÊªºÄæ¦ìª«¥ó·|¦Û°Ê¦a¥[¤J¨ìµ{¦¡®w³æ¤¸ªºTForm«¬¦¡©w¸q¤¤ ¡A¥¦­Ì¦sÀɦbÀ³¥Îµ{¦¡¤¤¡A§Y¨Ï¸ê®Æ®wªíªº°ò¥»µ²ºcµo¥Í¤F§ïÅÜ¡A¥¦¤]¬O¤@ª½«O¯dµÛ¡A·íµM¦pªG­×§ï«áªºªí¤¤¨Ï±o­ì¨Ó©Ò©w¸qªºÄæ¦ìª«¥ó¤£¦A¦s¦b¡ADelphiÀ³¥Îµ{¦¡¦b°õ¦æ¹Lµ{¤¤·|µ¹¥X²{¿ù»~¸ê°T¡C¡@

14.4.1 Äæ¦ìª«¥óªº«¬¦¡¡@

Äæ¦ìª«¥óTField¹ïÀ³¸ê®Æ®w°O¿ý¤¤ªº¦U­ÓÄæ¦ì¡A¦]¬°¸ê®Æ®w°O¿ý¤¤ªºÄæ¦ì¦³¦hºØ¼Æ¾Ú«¬¦¡¡A¦]¦¹¹ï°O¿ýÄæ¦ì¥i¯à¥X²{ªº¨C¤@ºØ¼Æ¾Ú«¬¦¡³£¦³¤@­Ó¿W¥ßªºTField«¬¦¡»P¤§¹ïÀ³¡CTFieldªº«¬¦¡¦pªí14.4©Ò¥Ü¡@

ªí14.4 Äæ¦ìª«¥óªº«¬¦¡

¢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

Äæ¦ìª«¥óªº«¬¦¡ ¹ïÀ³ªº¼Æ¾Ú«¬¦¡

¡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

TBooleanField ¥¬º¸«¬¼Æ¾Ú

TCurrentyField ³f¹ô«¬¼Æ¾Ú

TStringField ¦r¤¸¦ê¼Æ¾Ú

TIntegerField ¾ã¼Æ«¬¼Æ¾Ú

TBLOB ¤j¤G¶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¡@

         ¦b¤j¦h¼Æ±¡ªp¤U¥i¯à¨Ï¥Îªº¬OTStringField©MTIntegerField«¬¦¡ªºÄæ¦ìª«¥ó¡A ±qµ{¦¡³]­pªº¨¤«×¨Ó¬Ý³o¨ÇTFieldª«¥óªº¤£¦P«¬¦¡¬O§¹¥þ¬Û¦Pªº¡AÀ³¥Îµ{¦¡¬O®Ú¥»¤£¥²Ãö¤ßTFieldª«¥óªº¹ê»Ú«¬¦¡¡A¥¦­Ì¤§¶¡ªº¥D­n°Ï§O¦b©ó¡G¥¦­Ì¤º³¡«O¯dªº¥H¤Î¥¦­Ì©M¸ê®Æ®wªí¤§¶¡¶Ç»¼ªº¼Æ¾Ú«¬¦¡¤£¤@¼Ë¡C

14.4.2 «Ø¥ß¥Ã¤[©ÊªºÄæ¦ìª«¥ó¡@

        §Ú­Ìª¾¹DÄæ¦ìª«¥ó¦b³]­p©M°õ¦æ¶¥¬q³£¬O¤£¥i¨£ªº¡A¥¦¬J¥i¥HÀHµÛºÏºÐ¤Wªº¸ê®Æ®w¤å¥ó³Q¥´¶}®É°ÊºA¦a²£¥Í¤]¥i¥H³q¹LÄæ¦ì½s¿è¾¹Fields Editor¨Ó«Ø¥ß¥¦¡C ¦bÀ³¥Îµ{¦¡¤¤¨Ï¥ÎFields Editor¥i¥H¬°¸ê®Æ®wªí¤¤ªºÄæ¦ì«Ø¥ß¬ÛÀ³ªº¥Ã¤[©ÊªºTFieldª«¥ó¡ATField ³¡¥ó¬O¤£¥i¨£ªº³¡¥ó¡A¦ý¬O³q¹L¥¦¡A§Ú­Ì¥i¥H©w¸q¸ê®Æ®wªí¤¤¦UÄæ¦ìªºÅã¥ÜÄÝ©Ê©MÅã¥Ü¶¶§Ç¥H¤Î±±¨îÄæ¦ìªº¨ú­È½d³òµ¥¡C¤U­±ªº¨Ò¤l¡A§i¶D§Ú­Ì¦p¦ó¨Ï¥ÎFields Editor©w¸qCustomer.DBªí¤¤ªº¥|Äæ¦ì¡A¨Ã¦bºô®æ¤¤Åã¥Üªí¤¤ªº°O¿ý¸ê°T¡C

¾Þ§@¨BÆJ¡G

¢°¡B«Ø¥ß¤@­Ó°ò©ó customer. DB ªíªº¸ê®Æ®wÀ³¥Îµ¡Åé¡A ¨Ã¦bµ¡Å餤¥Î¤@­Óºô®æÅã¥Ücustomer.DB¤¤ªº¥þ³¡Äæ¦ì¡A¸Ô²Ó¤èªk½Ð°Ñ¨£14.1¸`¡A«Ø¦nªºµ¡Åé¦p¹Ï14.1©Ò¥Ü¡C

¢±¡B³]©wµ¡Å餤Table1ªºActiveÄݩʬ°True¡A¨Ïºô®æÅã¥Üªí¤¤ªº°O¿ý¡C

¢²¡B¿ï¤¤Table1¨Ã³sÄò«ö¨â¤U·Æ¹«¥ªÁä¡A¥´¶}Äæ¦ì½s¿è¾¹Fields Editor¡A ¯Ê¬Ù±¡ªp¤UÄæ¦ì²M³æ¬°ªÅ¡C

¢³¡B«ö¤@¤U·Æ¹«¥kÁä¼u¥X¤@­Ó¼u¥X¦¡¿ï¾Üªí¡AµM«á¿ï¾ÜAdd Fields¿ï¾Üªí¶µ¡A¯Ê¬Ù±¡ªp¤UªíCustomer.DB¤¤ªº¥þ³¡Äæ¦ì³Q¿ï¶iÄæ¦ì¦C¥Ü¤è¶ô¡C ±qÄæ¦ì¦C¥Ü¤è¶ô¤¤¿ï¾Ü§A­n¦bºô®æ¤¤Åã¥ÜªºÄæ¦ì¡A¨ãÅé°µªk¬O¡G«ö¤@¤UCustnoÄæ¦ì¡A¨Ã«ö¦íCTRÁä¡A¦A«ö¤@¤UCompany¡BPhone¡BLastInviceDateÄæ¦ì¡AµM«á«ö¤@¤UOK«ö¶s¡A½T»{³Q¿ï¾Üªº¥|­ÓÄæ¦ì¡A®Éµ¡Å餤ªºDBGrid1¤¤¥uÅã¥Ü­è¤~³Q¿ï¤¤ªº¥|­ÓÄæ¦ì­È¡A¦Ó¤£¦AÅã¥Üªí¤¤¨ä¥¦ªºÄæ¦ì­È¡C

¡@


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