2

trying to implement a query viewer in FMX Windows, which allows user to write a query and display its results.

the problem at hand is with fields of type Currency (or BCD, depending on the database), which is being rendered into the grid as "(BCD)" as shown below:

output

this question describes the exact same problem, specifically for FireDAC users. For the sake of trying, using FireDAC, the amounts in Currency fields are displaying correctly.

However, I am not using FireDAC. In fact, I am not using one specific set of DACs, as it varies with the underlying database in use.

I checked the options available in TBindSourceDB, the grid itself, but none would render the amounts correctly.

Any suggestions on solving this (other than converting the application to VCL and using a TDBGrid)?

Edit:

Delphi 10.3

DAC: TADSTable (Advantage), TEDBTable (ElevateDB) to name a few

MVCE: not much coding to share here, just drop 2 components, a TGrid and a data-access-component mentioned above (with a Currency field), link them up via visual livebindings and that's it.

Khorkhe
  • 1,024
  • 1
  • 11
  • 26
  • 1
    Bit vague on the details which means re-producing the issue looks like it could be a more effort than it's worth. A [MCVE](https://stackoverflow.com/help/minimal-reproducible-example) would alleviate that. Or more details - what Delphi version, connector, query, database, table definition etc. – Brian Jul 04 '22 at 17:15
  • @Brian details added, but not much of an MVCE to share - downside of no-code visual binding... hope this helps clarify a bit. – Khorkhe Jul 05 '22 at 12:23
  • built an MCVE, but it requires sharing the DAC dcus and the database's DLLs to work. Any suggestions? – Khorkhe Jul 05 '22 at 13:08

1 Answers1

0

came back to this problem after a few months, and managed to resolve it, so here's how it worked:

Removed the TGrid, and used a TStringGrid instead. Now the livebindings are able to render fields of type Currency without any extra manual configuration.

Khorkhe
  • 1,024
  • 1
  • 11
  • 26