| View previous topic :: View next topic |
| Author |
Message |
Mark Moss Guest
|
Posted: Wed Jun 14, 2006 12:10 am Post subject: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Dec |
|
|
Ladies / Gentlemen
I have a field that is defined in MSSQL 2000 as
Latitude - numeric - Length 5 - Precision 9 - Scale 6
You can enter data such as '325.564276'
It is coming back via the TADOQuery as a TBCDField instead of a
TFMTBCDField.
The problem is a TBDCField only allows 4 digits - so it is rounding
the data sent to the program
What should I be defining the datatype to be if I want it to come
back as a TFMTBCDField?
Mark Moss |
|
| Back to top |
|
 |
Ralf Jansen Guest
|
Posted: Wed Jun 14, 2006 1:08 am Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, |
|
|
Set TADOQuery.EnableBCD to false. You will get TFloatfield instead of TBcdField.
IIRC there is no buid in way to get them as TFMTBCDField.
You may try to set them up as persistent field yourself but i don't think that this will work.
Ralf |
|
| Back to top |
|
 |
Brian Bushay TeamB Guest
|
Posted: Wed Jun 14, 2006 6:12 am Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, |
|
|
| Quote: | Ladies / Gentlemen
I have a field that is defined in MSSQL 2000 as
Latitude - numeric - Length 5 - Precision 9 - Scale 6
You can enter data such as '325.564276'
It is coming back via the TADOQuery as a TBCDField instead of a
TFMTBCDField.
The problem is a TBDCField only allows 4 digits - so it is rounding
the data sent to the program
What should I be defining the datatype to be if I want it to come
back as a TFMTBCDField?
Delphi implementation of ADO does not support TfmtBCD. |
Turn of the EnableBCD property of your dataset and you will get a Tfloat which
will work for your field
--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com |
|
| Back to top |
|
 |
Tor Helland Guest
|
Posted: Wed Jun 14, 2006 8:10 am Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, |
|
|
| Quote: | If you really want to have a TFmtBCDField you have to include ftFmtBCD
and handling of it in a couple of places:
|
Sorry, forgot to mention my Delphi version: 6.02
-tor |
|
| Back to top |
|
 |
Tor Helland Guest
|
Posted: Wed Jun 14, 2006 8:10 am Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, |
|
|
Mark Moss is rumoured to have said:
| Quote: | What should I be defining the datatype to be if I want it to
come back as a TFMTBCDField?
|
If you really want to have a TFmtBCDField you have to include ftFmtBCD
and handling of it in a couple of places:
1. Modify AdoDb.DataTypeValues
2. Modify or override AdoDb.TCustomADODataSet.InternalInitFieldDefs
3. Modify or override AdoDb.TCustomADODataSet.GetFieldData
4. Modify or override AdoDb.TCustomADODataSet.SetFieldData
Problem is, DataTypeValues is in implementation, so you have to patch
AdoDb at least a little.
-tor |
|
| Back to top |
|
 |
|