CanModify属性表示你能不修改。你看看这个值是true或false;
下面英文也介绍有些数据为什么不能修改。
indicates whether the dataset permits write access to data.
property CanModify: Boolean;
Description
As implemented in TDataSet, this property is False if the dataset is unidirectional, and True otherwise. Descendant classes reimplement this property as follows
For unidirectional datasets, CanModify is always False.
For client datasets, CanModify reflects the value of the ReadOnly property and whether a data provider supplied a read-only data packet.

解决方案 »

  1.   

    不好意思,与补丁无关,你可以看看完了
    FieldByName('Number').AsString:=CBNumber.Text ;
    后的ADODataSet的State的值是什么?如果是dsBrowse 则表示你的字段的ONchange事件
    将该adodataset的值给post掉了
      

  2.   

    对,我已经查了,STATE的值为DSBROWSE,如果是这样,该怎么解决呢,急盼回答
      

  3.   

    with RateTable do
              begin  //1
                Open;
                DisableControls;
                try
                  Edit;//加入此使RateTable处于编辑状态下
                  insert;
                  IndexFieldNames:='Number';
                  FieldByName('Number').AsString:=CBNumber.Text ;
                  FieldByName('StandardRate').AsFloat:=StandardCount;
                  FieldByName('BackgroundRate').AsFloat:=BgAfterCount;
                post;
                finally
                  EnableControls;
                end;
              end;
      

  4.   

    对,我已经查了,CanModify的值为TRUE,如果是这样,该怎么解决呢,急盼回答 
      

  5.   

    To RAbbit_Lap():
    Insert之前还要先edit吗??
      

  6.   

    应该是post时出的错,去掉试试!!
      

  7.   

    with RateTable do
              begin  //1
                Open;
                DisableControls;
                try
                  insert;
                  IndexFieldNames:='Number';
                  FieldByName('Number').AsString:=CBNumber.Text ;
                  FieldByName('StandardRate').AsFloat:=StandardCount;
                  FieldByName('BackgroundRate').AsFloat:=BgAfterCount;
                  //
                  if state in [dsedit,dsinsert] then
                     post;
                  //
                finally
                  EnableControls;
                end;
              end;
      

  8.   

    你的IndexFieldNames为什么一定要在这里赋值呀?放到最前面行不行???
    你是不是有一个字段的OnChange事件里面有东东?
    如果是的话,检查一下看看嘛,把代码拿出来看看喽
      

  9.   

    谢谢,我把IndexFieldNames:='Number';放在INSERT前面,这个问题解决,但同时出现了index is read only的提示,这是什么原因