Subject | [firebird-support] "could not convert variant of type (null) into type (currency)" |
---|---|
Author | Rustam |
Post date | 2019-08-28T08:39:21Z |
If your client app written in Delphi, there is bad usage of Variant type in your code (or external components).
Absent one of checks when converting Variant to Currency, e.g.:
procedure TForm1.Button1Click(Sender: TObject);
var
C: Currency;
V: Variant;
begin
V := 10;
C := V; // Works
Edit1.Text := FloatToStr(C);
V := Null;
C := V; // Error
Edit1.Text := FloatToStr(C);
V := Null;
// Correct usage
if VarIsNull(V) then C := 0 else C := V;
Edit1.Text := FloatToStr(C);
end;