浏览代码

- check for editable state in SetFieldData

joost 20 年之前
父节点
当前提交
734aa62d36
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      fcl/db/bufdataset.inc

+ 5 - 0
fcl/db/bufdataset.inc

@@ -421,6 +421,11 @@ var
   FieldUpdBuf : PFieldUpdateBuffer;
 
 begin
+  if not (state in [dsEdit, dsInsert]) then
+    begin
+    DatabaseErrorFmt(SNotInEditState,[NAme],self);
+    exit;
+    end;
   If Field.Fieldno > 0 then // If = 0, then calculated field or something
     begin
     CurrBuff := ActiveBuffer;