MS SQL currency type shown as float in schema builder


ah yes, it for queries only.

try NumericType=ntBCD instead

hmm, is this AV reproduced in runtime?

no no, i’m trying the solution in the schema builder
but for some reason the connection is also flagged as

try launch your server under debugging. it should give call-stack for this error

it’s the schema builder that throws this error, don’t think the runtime will be affected

restarting the IDE solves the connection issue…

I’ll log issue that allows to set such parameters via

Thanks, logged as bugs://83006

the answer i got from sdac

By default, SDAC creates TCurrencyField in Delphi for “currency” type fields from a database.
You can verify this by running the SQL statement without using Remobjects DataAbstract, e.g.:

[uid] [int] IDENTITY(1,1) NOT NULL,
[c_money] [money] NULL,
[c_smallmoney] [smallmoney] NULL

procedure TForm1.buOpenClick(Sender: TObject); begin

Memo1.Lines.Add(MSQuery1.FieldByName(‘c_money’).FieldName + ': ’ + MSQuery1.FieldByName(‘c_money’).ClassName);

Remobjects DataAbstract might set the field type to float for numeric fields on a client by default.
Try to explicitly set the data type if possible.

bugs://83006 got closed with status fixed.

the issue in another:
SDAC treats money as TCurrencyField that actually is TFloatField:

  TCurrencyField = class(TFloatField)
    constructor Create(AOwner: TComponent); override;
    { Lowercase to avoid name clash with C++ Currency type }
    property currency default True;

and value is stored as double

DA uses TBCDField for money type that is more suitable for currency type.

I’ve added a new option to SDAC driver - UseBCDforMoneyTypes that adds correspondent mapping to SDAC driver.

uDASDACDriver.pas (15.4 KB)


  • compile ..\Data Abstract for Delphi\Source\Drivers\DASDACDrv.dpr with any unicode version of Delphi
  • replace ..\Data Abstract (Common)\Bin\ with compiled file
  • add UseBCDforMoneyTypes=1 to connection string

after this, money types will be detected correctly in SDAC driver

I’d say make this the default?

hi Evgeny,

is this included in the 10.x release which just got out? (i saw that the 82997 is already included so…)

no, it isn’t.
release was created two days ago, but this fix (bugs://83006) was fixed yesterday …

ok no problem

use this instruction

good idea, will

1 Like