Browse Source

fcl-db: bufdataset: Check if blob field is not ReadOnly when blob stream is created (in bmWrite mode). Bug #25648

git-svn-id: trunk@26621 -
lacak 11 years ago
parent
commit
03e76b5f8b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/fcl-db/src/base/bufdataset.pas

+ 2 - 0
packages/fcl-db/src/base/bufdataset.pas

@@ -2736,6 +2736,8 @@ begin
     begin
     if not (State in [dsEdit, dsInsert, dsFilter, dsCalcFields]) then
       DatabaseErrorFmt(SNotEditing,[Name],self);
+    if Field.ReadOnly and not (State in [dsSetKey, dsFilter]) then
+      DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName]);
 
     result := TBufBlobStream.Create(Field as TBlobField, bmWrite);
     end;