当修改显示的表中的内容时候,如何知道修改了哪个字段的值,值为多少???

解决方案 »

  1.   

    当DataSet为TClientDataSet或允许 cached updates 时,可以使用 NewValue或OldValue分别得到修改后的值和修改前的值。
    用DataSet.Modified可以知道整个数据集有没有被修改。
    至于TDBNavigator的会在按键后触发一个事件(在数据集自动处理前):
    property BeforeAction: ENavClick;
    它是这样定义的:
    type 
      ENavClick = procedure (Sender: TObject; Button: TNavigateBtn) of object;
    其中,TNavigageBtn的定义如下:
    type TNavigateBtn = (nbFirst, nbPrior, nbNext, nbLast, nbInsert, nbDelete, nbEdit, nbPost, nbCancel, nbRefresh);可选值:Button Value Action
    --------------------------------------------
    First nbFirst Go to the first record
    Prior nbPrior Go to the previous record
    Next nbNext Go to the next record
    Last nbLast Go to the last record
    Insert nbInsert Insert a blank record
    Delete nbDelete Delete the current record
    Edit nbEdit Permit users to edit the current record
    Post nbPost Post the current record
    Cancel nbCancel Cancel the current edit
    Refresh nbRefresh Refresh the data in the dataset