fcl-db: base: +TParam.AsByte (for Delphi compatibility)

git-svn-id: trunk@49603 -
This commit is contained in:
lacak 2021-07-12 12:17:03 +00:00
parent 723371b30a
commit ab86ce7e62
2 changed files with 10 additions and 0 deletions

View File

@ -1325,6 +1325,7 @@ type
Procedure SetAsBCD(const AValue: Currency);
Procedure SetAsBlob(const AValue: TBlobData);
Procedure SetAsBoolean(AValue: Boolean);
Procedure SetAsByte(const AValue: LongInt);
Procedure SetAsBytes(const AValue: TBytes);
Procedure SetAsCurrency(const AValue: Currency);
Procedure SetAsDate(const AValue: TDateTime);
@ -1364,6 +1365,7 @@ type
Property AsBCD : Currency read GetAsCurrency write SetAsBCD;
Property AsBlob : TBlobData read GetAsBytes write SetAsBlob;
Property AsBoolean : Boolean read GetAsBoolean write SetAsBoolean;
Property AsByte : LongInt read GetAsInteger write SetAsByte;
Property AsBytes : TBytes read GetAsBytes write SetAsBytes;
Property AsCurrency : Currency read GetAsCurrency write SetAsCurrency;
Property AsDate : TDateTime read GetAsDateTime write SetAsDate;

View File

@ -748,6 +748,12 @@ begin
Value:=AValue;
end;
procedure TParam.SetAsByte(const AValue: LongInt);
begin
FDataType:=ftByte;
Value:=AValue;
end;
Procedure TParam.SetAsBytes(const AValue: TBytes);
begin
FDataType:=ftVarBytes;
@ -968,6 +974,7 @@ begin
if Assigned(Field) then
case FDataType of
ftUnknown : DatabaseErrorFmt(SUnknownParamFieldType,[Name],DataSet);
ftByte : Field.AsInteger:=AsByte;
// Need TField.AsSmallInt
ftSmallint : Field.AsInteger:=AsSmallInt;
// Need TField.AsWord
@ -1009,6 +1016,7 @@ begin
FDataType:=Field.DataType;
case Field.DataType of
ftUnknown : DatabaseErrorFmt(SUnknownParamFieldType,[Name],DataSet);
ftByte : AsByte:=Field.AsInteger;
// Need TField.AsSmallInt
ftSmallint : AsSmallint:=Field.AsInteger;
// Need TField.AsWord