mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +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 SetAsBlob(const AValue: TBlobData); virtual;
|
||||||
Procedure SetAsBoolean(AValue: Boolean); virtual;
|
Procedure SetAsBoolean(AValue: Boolean); virtual;
|
||||||
Procedure SetAsBytes(const AValue: TBytes); virtual;
|
Procedure SetAsBytes(const AValue: TBytes); virtual;
|
||||||
Procedure SetAsBlobData(const AValue: TBlobData); virtual;
|
|
||||||
Procedure SetAsCurrency(const AValue: Currency); virtual;
|
Procedure SetAsCurrency(const AValue: Currency); virtual;
|
||||||
Procedure SetAsDate(const AValue: TDateTime); virtual;
|
Procedure SetAsDate(const AValue: TDateTime); virtual;
|
||||||
Procedure SetAsDateTime(const AValue: TDateTime); virtual;
|
Procedure SetAsDateTime(const AValue: TDateTime); virtual;
|
||||||
@ -1248,7 +1247,7 @@ type
|
|||||||
Procedure SetBlobData(Buffer: Pointer; ASize: Integer);
|
Procedure SetBlobData(Buffer: Pointer; ASize: Integer);
|
||||||
Procedure SetData(Buffer: Pointer);
|
Procedure SetData(Buffer: Pointer);
|
||||||
Property AsBCD : Currency read GetAsCurrency write SetAsBCD;
|
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 AsBoolean : Boolean read GetAsBoolean write SetAsBoolean;
|
||||||
Property AsBytes : TBytes read GetAsBytes write SetAsBytes;
|
Property AsBytes : TBytes read GetAsBytes write SetAsBytes;
|
||||||
Property AsCurrency : Currency read GetAsCurrency write SetAsCurrency;
|
Property AsCurrency : Currency read GetAsCurrency write SetAsCurrency;
|
||||||
|
@ -593,7 +593,7 @@ var P: Pointer;
|
|||||||
begin
|
begin
|
||||||
If IsNull then
|
If IsNull then
|
||||||
Result:=''
|
Result:=''
|
||||||
else if (FDataType in [ftBytes, ftVarBytes]) and VarIsArray(FValue) then
|
else if (FDataType in [ftBytes, ftVarBytes, ftBlob]) and VarIsArray(FValue) then
|
||||||
begin
|
begin
|
||||||
SetLength(Result, (VarArrayHighBound(FValue, 1) + 1) div SizeOf(Char));
|
SetLength(Result, (VarArrayHighBound(FValue, 1) + 1) div SizeOf(Char));
|
||||||
P := VarArrayLock(FValue);
|
P := VarArrayLock(FValue);
|
||||||
@ -700,12 +700,6 @@ begin
|
|||||||
Value:=AValue;
|
Value:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TParam.SetAsBlobData(const AValue: TBlobData);
|
|
||||||
begin
|
|
||||||
FDataType:=ftBlob;
|
|
||||||
Value:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Procedure TParam.SetAsCurrency(const AValue: Currency);
|
Procedure TParam.SetAsCurrency(const AValue: Currency);
|
||||||
begin
|
begin
|
||||||
FDataType:=ftCurrency;
|
FDataType:=ftCurrency;
|
||||||
@ -887,7 +881,7 @@ begin
|
|||||||
AssignParam(TParam(Source))
|
AssignParam(TParam(Source))
|
||||||
else if (Source is TField) then
|
else if (Source is TField) then
|
||||||
AssignField(TField(Source))
|
AssignField(TField(Source))
|
||||||
else if (source is TStrings) then
|
else if (Source is TStrings) then
|
||||||
AsMemo:=TStrings(Source).Text
|
AsMemo:=TStrings(Source).Text
|
||||||
else
|
else
|
||||||
inherited Assign(Source);
|
inherited Assign(Source);
|
||||||
@ -1120,7 +1114,6 @@ begin
|
|||||||
DatabaseErrorFmt(SBadParamFieldType,[Name],DataSet);
|
DatabaseErrorFmt(SBadParamFieldType,[Name],DataSet);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TParam.LoadFromFile(const FileName: string; BlobType: TBlobType);
|
Procedure TParam.LoadFromFile(const FileName: string; BlobType: TBlobType);
|
||||||
|
Loading…
Reference in New Issue
Block a user