mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 09:50:38 +02:00
fcl-db: base: Fix "Invalid variant type cast" (when converting variant byte array to string) + remove unneded method (Delphi compat.)
git-svn-id: trunk@39337 -
This commit is contained in:
parent
c550bc1065
commit
e9e9a26133
@ -1212,7 +1212,6 @@ type
|
||||
Procedure SetAsBlob(const AValue: TBlobData); virtual;
|
||||
Procedure SetAsBoolean(AValue: Boolean); virtual;
|
||||
Procedure SetAsBytes(const AValue: TBytes); virtual;
|
||||
Procedure SetAsBlobData(const AValue: TBlobData); virtual;
|
||||
Procedure SetAsCurrency(const AValue: Currency); virtual;
|
||||
Procedure SetAsDate(const AValue: TDateTime); virtual;
|
||||
Procedure SetAsDateTime(const AValue: TDateTime); virtual;
|
||||
@ -1248,7 +1247,7 @@ type
|
||||
Procedure SetBlobData(Buffer: Pointer; ASize: Integer);
|
||||
Procedure SetData(Buffer: Pointer);
|
||||
Property AsBCD : Currency read GetAsCurrency write SetAsBCD;
|
||||
Property AsBlob : TBlobData read GetAsBytes write SetAsBlobData;
|
||||
Property AsBlob : TBlobData read GetAsBytes write SetAsBlob;
|
||||
Property AsBoolean : Boolean read GetAsBoolean write SetAsBoolean;
|
||||
Property AsBytes : TBytes read GetAsBytes write SetAsBytes;
|
||||
Property AsCurrency : Currency read GetAsCurrency write SetAsCurrency;
|
||||
|
@ -593,7 +593,7 @@ var P: Pointer;
|
||||
begin
|
||||
If IsNull then
|
||||
Result:=''
|
||||
else if (FDataType in [ftBytes, ftVarBytes]) and VarIsArray(FValue) then
|
||||
else if (FDataType in [ftBytes, ftVarBytes, ftBlob]) and VarIsArray(FValue) then
|
||||
begin
|
||||
SetLength(Result, (VarArrayHighBound(FValue, 1) + 1) div SizeOf(Char));
|
||||
P := VarArrayLock(FValue);
|
||||
@ -700,12 +700,6 @@ begin
|
||||
Value:=AValue;
|
||||
end;
|
||||
|
||||
procedure TParam.SetAsBlobData(const AValue: TBlobData);
|
||||
begin
|
||||
FDataType:=ftBlob;
|
||||
Value:=AValue;
|
||||
end;
|
||||
|
||||
Procedure TParam.SetAsCurrency(const AValue: Currency);
|
||||
begin
|
||||
FDataType:=ftCurrency;
|
||||
@ -887,7 +881,7 @@ begin
|
||||
AssignParam(TParam(Source))
|
||||
else if (Source is TField) then
|
||||
AssignField(TField(Source))
|
||||
else if (source is TStrings) then
|
||||
else if (Source is TStrings) then
|
||||
AsMemo:=TStrings(Source).Text
|
||||
else
|
||||
inherited Assign(Source);
|
||||
@ -1120,7 +1114,6 @@ begin
|
||||
DatabaseErrorFmt(SBadParamFieldType,[Name],DataSet);
|
||||
end;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
Procedure TParam.LoadFromFile(const FileName: string; BlobType: TBlobType);
|
||||
|
Loading…
Reference in New Issue
Block a user