* TBlobField must bet TBinaryField descendent, but needs to allow size 0

This commit is contained in:
michael 2019-03-12 08:11:52 +00:00
parent 8619a9f296
commit b4fb0f45dd

View File

@ -662,7 +662,7 @@ type
TBlobStreamMode = (bmRead, bmWrite, bmReadWrite);
// TBlobType = ftBlob..ftMemo;
TBlobField = class(TField)
TBlobField = class(TBinaryField)
private
FModified : Boolean;
// Wrapper that retrieves FDataType as a TBlobType
@ -670,6 +670,7 @@ type
// Wrapper that calls SetFieldType
// procedure SetBlobType(AValue: TBlobType);
protected
class procedure CheckTypeSize(AValue: Longint); override;
function GetBlobSize: Longint; virtual;
function GetIsNull: Boolean; override;
procedure GetText(var AText: string; ADisplayText{%H-}: Boolean); override;
@ -7027,6 +7028,11 @@ end;
class procedure TBlobField.CheckTypeSize(AValue: Longint);
begin
If AValue<0 then
DatabaseErrorFmt(SInvalidFieldSize,[AValue]);
end;
function TBlobField.GetBlobSize: Longint;