mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-26 07:20:44 +01:00
fcl-db: base: +TParam.AsByte (for Delphi compatibility)
git-svn-id: trunk@49603 -
This commit is contained in:
parent
723371b30a
commit
ab86ce7e62
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user