Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/TField    [ Add a report in this area ]  
Report #:  5938   Status: Closed
Imporper initialization of Size field for TFMTBCDField
Project:  Delphi Build #:  7.0.4.453
Version:    7.0 Submitted By:   Thomas Miller
Report Type:  Crash / Data loss / Total failure Date Reported:  9/12/2003 9:56:15 AM
Severity:    Critical / Show Stopper Last Updated: 6/27/2006 12:28:20 PM
Platform:    95, 98, 2000, NT, XP Internal Tracking #:   178312
Resolution: Fixed (Resolution Comments) Resolved in Build: : 7.0.8.1
Duplicate of:  None
Voting and Rating
Overall Rating: (4 Total Ratings)
4.75 out of 5
Total Votes: 7
Description
Initializes to size 8 when it should be size 4.

This allows the system to initialize precision to 7 and size to 8 which
closes down Delphi itself during programming without even as much
as an exception.
Steps to Reproduce:
TFMTBCDField = class(TNumericField)

Published

  property Size default 4;


{ TFMTBCDField }

constructor TFMTBCDField.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  SetDataType(ftFMTBCD);
  Size := 8;    // Should this be a 4 ?
  ValidChars := [DecimalSeparator, '+', '-', '0'..'9'];
  FMinValue := '';
  FMaxValue := '';
end;

======================================

Using dbExpressPlus, set the Options = coBcdToFMTBcd
This forces all "NUMERIC" types to for compatability.

This forces let's say a NUMERIC(7,4) to be created as
a FmtBCD.  Since the column type has a SIZE of 4 and
is not stored in the dfm, when it is recreated, it is always
set back to SIZE = 8.  When the TClientDataset is activiated,
a BCDNormalize procedure is run and on exit of the procedure
it shuts down Delphi.  I am assuming that it does this because
the Precision is smaller then the Size which is an impossibility.

The funny thing is, you can open the TSQLQuery related to
it without problem.
Workarounds
None
Attachment
QC5938.ZIP
Comments

Luigi Sandon at 9/12/2003 2:54:34 PM -
D6 has this bug too

Server Response from: CODE1