|
@@ -128,7 +128,7 @@ How to Install
|
|
interface
|
|
interface
|
|
|
|
|
|
uses
|
|
uses
|
|
- DB, Classes, SysUtils;
|
|
|
|
|
|
+ DB, Classes, SysUtils, DBConst;
|
|
|
|
|
|
type
|
|
type
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
@@ -664,16 +664,17 @@ var
|
|
RecBuf, BufEnd: PChar;
|
|
RecBuf, BufEnd: PChar;
|
|
p : Integer;
|
|
p : Integer;
|
|
begin
|
|
begin
|
|
- if not (State in [dsEdit, dsInsert]) then
|
|
|
|
- DatabaseError('Dataset not in edit or insert mode', Self);
|
|
|
|
|
|
+ if not (State in dsWriteModes) then
|
|
|
|
+ DatabaseError(SNotEditing, Self);
|
|
GetActiveRecBuf(RecBuf);
|
|
GetActiveRecBuf(RecBuf);
|
|
if Field.FieldNo > 0 then
|
|
if Field.FieldNo > 0 then
|
|
begin
|
|
begin
|
|
if State = dsCalcFields then
|
|
if State = dsCalcFields then
|
|
DatabaseError('Dataset not in edit or insert mode', Self);
|
|
DatabaseError('Dataset not in edit or insert mode', Self);
|
|
if Field.ReadOnly and not (State in [dsSetKey, dsFilter]) then
|
|
if Field.ReadOnly and not (State in [dsSetKey, dsFilter]) then
|
|
- DatabaseErrorFmt('Field ''%s'' cannot be modified', [Field.DisplayName]);
|
|
|
|
- Field.Validate(Buffer);
|
|
|
|
|
|
+ DatabaseErrorFmt(SReadOnlyField, [Field.DisplayName]);
|
|
|
|
+ if State in [dsEdit, dsInsert, dsNewValue] then
|
|
|
|
+ Field.Validate(Buffer);
|
|
if Field.FieldKind <> fkInternalCalc then
|
|
if Field.FieldKind <> fkInternalCalc then
|
|
begin
|
|
begin
|
|
SetFieldPos(RecBuf, Field.FieldNo);
|
|
SetFieldPos(RecBuf, Field.FieldNo);
|