Link to home
Start Free TrialLog in
Avatar of scones
scones

asked on

how to use valuta field in mdb in a DBGrid

I am using Delphi 6 and an MSAccess database with a field 'valuta'. How can I use a DBGrid with a Query and showing the data in the correct format 'valuta'
Now the result is not a correct currency like $ 123.90 but the result is now 123.9 without the dollar sign an without the 0 on the end.
Avatar of ILE
ILE


all you need you asign the valuta in your
controlpanel
regionalsetings
then goto tab curency


if u vont to do something vith the delphi comands then
yse this

CurrencyString: string[7];
CurrencyFormat: Byte;
NegCurrFormat: Byte;
ThousandSeparator: Char;
DecimalSeparator: Char;
CurrencyDecimals: Byte;

all of this is in the sysutils;

easy arent:




Avatar of kretzschmar
change the fieldtype to ftCurrency
Avatar of scones

ASKER

Comment to ILE:
my regional settings are correct.
Comment to kretzschmar:
It is not possible to change the MSAccess mdb database with the field ftCurrency, because I can only choose the fieldtype valuta.
When I am using a Paradox database than I can use of course the fieldtype Currency.
My question is: is it possible to make a conversion or something like that in SQL or in an other way, so I can use the .mdb database with the correct presentation?
well ok,
then it is just an output-problem,

use the onsettext/ongettext-events of the fields
to format the value in the manner you need

see the CurrToStr and strToCurr functions

meikl ;-)

Avatar of scones

ASKER

meikl,
yes, it is a output problem in my DBGrid and in DBtext.
I cannot find the onsettext/ongettext-events. Can you explain it to me in an other way?
scones:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
https://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd and pts refunded

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer

P.S.
  Meikl, how about completing your answer now for others to see?
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial