I'm attempting to update an old Paradox (BDE) table using an older Delphi XE6 application. One particular table has two fields; a Date field, and a BCD field. I'm unable to post a new record to the (FuelSurch) table due to the BCD (FuelSur) field which is throwing a "Number is out of range" error.
So I wrote a quick test, but still the same issue. Here are the FuelSurch table field specifications.
I just added a button to a form and this procedure fires when clicked.
procedure TTestForm.BCDTestBtnClick(Sender: TObject);
var
Bcd: TBcd;
begin
POE_Data.FuelSurch.Open;
POE_Data.FuelSurch.Insert;
Bcd:= StrToBcd('2.01');
showMessage('Bcd = ' + BcdToStr(Bcd)); // This works and shows 'Bcd = 2.01'
POE_Data.FuelSurchFuelSur.AsBCD := Bcd; // Line produces "Number is out of range." error
POE_Data.FuelSurch.Post;
POE_Data.FuelSurch.Close;
end;
The database connection is confirmed as good as I'm able to post to other tables. It just seems like this BCD field type is giving me issues.
Do I need to format the string differently before assigning it to the Bcd variable?