BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

work with TBCDField

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
moritenw
Guest





PostPosted: Fri Sep 19, 2003 2:00 am    Post subject: work with TBCDField Reply with quote



I have a project used with TADODataset, the dataset bind a MSSQL table
include numeric(28, 5) Field(A).When i get the field on design state, the
type of field(A) returned is TBCDField with property precision = 28 and size
= 5.But the Value of Field(A) will be trunct to 4 fraction(0.2222) when i
input 5 fraction number(0.22222). what is the matter? Working environment is
delphi6 + mssql.please somebody tell me and help me?


Back to top
Ignacio Vazquez
Guest





PostPosted: Fri Sep 19, 2003 4:08 am    Post subject: Re: work with TBCDField Reply with quote



"moritenw" <moritenw (AT) 163 (DOT) net> wrote

Quote:
please somebody tell me and help me?

Sounds like you're using .AsCurrency to manipulate the field. Currency is
restricted to 4 decimal places so you should look at .AsFloat instead.

Cheers,
Ignacio




Back to top
moritenw
Guest





PostPosted: Fri Sep 19, 2003 6:11 am    Post subject: Re: work with TBCDField Reply with quote



That was not as you thouht. the value of property currency of Field(A) is
false.
I do input the value in a TDBGrid. The value was trunct after input the
value and leave the cell.

"Ignacio Vazquez" <ivazquezATorioncommunications.com> дÈëÓʼþ
news:3f6a8158 (AT) newsgroups (DOT) borland.com...
Quote:
"moritenw" <moritenw (AT) 163 (DOT) net> wrote in message
news:3f6a63a1 (AT) newsgroups (DOT) borland.com...
please somebody tell me and help me?

Sounds like you're using .AsCurrency to manipulate the field. Currency is
restricted to 4 decimal places so you should look at .AsFloat instead.

Cheers,
Ignacio






Back to top
John Herbster (TeamB)
Guest





PostPosted: Thu Oct 16, 2003 2:19 pm    Post subject: Re: work with TBCDField Reply with quote

"moritenw" <moritenw (AT) 163 (DOT) net> wrote
Quote:
I have a project used with TADODataset, the dataset bind
a MSSQL table include numeric(28, 5) Field(A).When i get
the field on design state, the type of field(A) returned is
TBCDField with property precision = 28 and size >= 5.
But the Value of Field(A) will be trunct to 4 fraction(0.2222)
when i input 5 fraction number(0.22222). what is the matter? ...

I notice in D7's Help:

"The IDE uses two different field types for representing BCD fields:
TBCDField and TFMTBCDField. TBCDField uses the Currency (Delphi) or
System::Currency (C++) type to manipulate BCD values. This is faster
than storing and manipulating the value using a true BCD type, but
limits the precision of the BCD values it can support to 4 decimal
places and 20 significant digits."

Thus it would appear that your dataset should be using the
field type TFMTBCDField. Can you change it?
Regards, JohnH


Back to top
moritenw
Guest





PostPosted: Fri Dec 12, 2003 1:53 am    Post subject: Re: work with TBCDField Reply with quote

thks for your respond. I had found the how to resovle it. just set the
property of TADODataSet EnableBCD to False, the it will generate the
TfloatField type rather than TBCDField type.

"John Herbster (TeamB)" <herb-sci1 (AT) sbcglobal (DOT) net> ????
news:3f8ea799$1 (AT) newsgroups (DOT) borland.com...
Quote:

"moritenw" <moritenw (AT) 163 (DOT) net> wrote
I have a project used with TADODataset, the dataset bind
a MSSQL table include numeric(28, 5) Field(A).When i get
the field on design state, the type of field(A) returned is
TBCDField with property precision = 28 and size >= 5.
But the Value of Field(A) will be trunct to 4 fraction(0.2222)
when i input 5 fraction number(0.22222). what is the matter? ...

I notice in D7's Help:

"The IDE uses two different field types for representing BCD fields:
TBCDField and TFMTBCDField. TBCDField uses the Currency (Delphi) or
System::Currency (C++) type to manipulate BCD values. This is faster
than storing and manipulating the value using a true BCD type, but
limits the precision of the BCD values it can support to 4 decimal
places and 20 significant digits."

Thus it would appear that your dataset should be using the
field type TFMTBCDField. Can you change it?
Regards, JohnH




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.