git-svn-id: trunk@6566 -
This commit is contained in:
joost 2007-02-19 21:45:30 +00:00
parent c2db154121
commit c9a2067b61
3 changed files with 21 additions and 15 deletions

View File

@ -847,6 +847,7 @@ Var tmpRecBuffer : PBufRecLinkItem;
NullMask : pbyte;
begin
inherited InternalPost;
if assigned(FUpdateBlobBuffers) then for i:=0 to length(FUpdateBlobBuffers)-1 do
if assigned(FUpdateBlobBuffers[i]) and (FUpdateBlobBuffers[i]^.FieldNo>0) then
begin

View File

@ -924,6 +924,25 @@ begin
ShowException(ExceptObject,ExceptAddr);
end;
procedure TDataSet.InternalPost;
Procedure Checkrequired;
Var I : longint;
begin
For I:=0 to FFieldList.Count-1 do
With FFieldList[i] do
// Required fields that are NOT autoinc !! Autoinc cannot be set !!
if Required and not ReadOnly and
(FieldKind=fkData) and Not (DataType=ftAutoInc) and IsNull then
DatabaseErrorFmt(SNeedField,[DisplayName],Self);
end;
begin
Checkrequired;
end;
procedure TDataSet.SetUniDirectional(const Value: Boolean);
begin
FIsUniDirectional := Value;
@ -1878,19 +1897,6 @@ end;
Procedure TDataset.Post;
Procedure Checkrequired;
Var I : longint;
begin
For I:=0 to FFieldList.Count-1 do
With FFieldList[i] do
// Required fields that are NOT autoinc !! Autoinc cannot be set !!
if Required and not ReadOnly and
(FieldKind=fkData) and Not (DataType=ftAutoInc) and IsNull then
DatabaseErrorFmt(SNeedField,[DisplayName],Self);
end;
begin
if State in [dsEdit,dsInsert] then
begin
@ -1899,7 +1905,6 @@ begin
{$ifdef dsdebug}
writeln ('Post: checking required fields');
{$endif}
CheckRequired;
DoBeforePost;
If Not TryDoing(@InternalPost,OnPostError) then exit;
cursorposchanged;

View File

@ -1131,7 +1131,7 @@ type
procedure InternalInitRecord(Buffer: PChar); virtual; abstract;
procedure InternalLast; virtual; abstract;
procedure InternalOpen; virtual; abstract;
procedure InternalPost; virtual; abstract;
procedure InternalPost; virtual;
procedure InternalSetToRecord(Buffer: PChar); virtual; abstract;
function IsCursorOpen: Boolean; virtual; abstract;
procedure SetBookmarkFlag(Buffer: PChar; Value: TBookmarkFlag); virtual; abstract;