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 

What maps to a 'tFMTBCDField' from MSSQL Server - Float, Dec

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





PostPosted: Wed Jun 14, 2006 12:10 am    Post subject: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Dec Reply with 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?

Mark Moss
Back to top
Ralf Jansen
Guest





PostPosted: Wed Jun 14, 2006 1:08 am    Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Reply with quote



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





PostPosted: Wed Jun 14, 2006 6:12 am    Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Reply with quote



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





PostPosted: Wed Jun 14, 2006 8:10 am    Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Reply with quote

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





PostPosted: Wed Jun 14, 2006 8:10 am    Post subject: Re: What maps to a 'tFMTBCDField' from MSSQL Server - Float, Reply with quote

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
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.