Board index » delphi » DBgrid and BCD field

DBgrid and BCD field


2005-10-12 12:33:56 AM
delphi168
 I have Delphi 7 and oracle 8. When I display the numeric field in
Dbgrid. Their value always show '0' even they have a value different '0'.
I even try to update these values and they are updated in the database
but they still show '0' in the dbgrid column.
Would anyone help me how to solve this bug?
Thanks,
Emily
--- posted by geoForum on delphi.newswhat.com
 
 

Re:DBgrid and BCD field

"Emily" <XXXX@XXXXX.COM>wrote
Quote
I have Delphi 7 and oracle 8. When I display the numeric field
in Dbgrid. Their value always show '0' even they have a value
different '0'.
Emily,
If you use very large values, what does it show in the TDBGrid?
What are you using for the DisplayFormat property of the
field object?
Rgds, JohnH
 

Re:DBgrid and BCD field

John,
On the DisplayFormat property of the field object, I set it like
this '#0.000'. But it always show '0'.
Emily
Quote

"Emily" <XXXX@XXXXX.COM>wrote
>I have Delphi 7 and oracle 8. When I display the numeric field
>in Dbgrid. Their value always show '0' even they have a value
>different '0'.

Emily,
If you use very large values, what does it show in the TDBGrid?
What are you using for the DisplayFormat property of the
field object?
Rgds, JohnH



--- posted by geoForum on delphi.newswhat.com
 

Re:DBgrid and BCD field

Quote
>>I have Delphi 7 and oracle 8. When I display the numeric field
>>in Dbgrid. Their value always show '0' even they have a value
>>different '0'.
>What are you using for the DisplayFormat property of the
>field object?
On the DisplayFormat property of the field object,
I set it like this '#0.000'. But it always shows '0'.
Emily,
That '#0.000' looks OK to me, but I am not an expert using
BCD with Oracle. Does even data like 9.999 show up as
'0'? Is there perhaps a OnGetText event handler attached to
the field that is substuting the '0'? All I can think to suggest
further is that you check the DisplayFormat property at
run-time, to see if something else has changed it.
Regards, JohnH
 

Re:DBgrid and BCD field

Thanks John.
I think the problem is FMTBCD.pas file but I don't know how to fix it.
Quote

>>>I have Delphi 7 and oracle 8. When I display the numeric field
>>>in Dbgrid. Their value always show '0' even they have a value
>>>different '0'.

>>What are you using for the DisplayFormat property of the
>>field object?

>On the DisplayFormat property of the field object,
>I set it like this '#0.000'. But it always shows '0'.

Emily,
That '#0.000' looks OK to me, but I am not an expert using
BCD with Oracle. Does even data like 9.999 show up as
'0'? Is there perhaps a OnGetText event handler attached to
the field that is substuting the '0'? All I can think to suggest
further is that you check the DisplayFormat property at
run-time, to see if something else has changed it.
Regards, JohnH

--- posted by geoForum on delphi.newswhat.com