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 

FieldByName('Latitude').Text; --- It is truncating the value

 
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: Tue Jun 13, 2006 7:33 am    Post subject: FieldByName('Latitude').Text; --- It is truncating the value Reply with quote



Ladies / Gentlemen

I am using ADO to access a MSSQL Server and when I issue the following it
only returns the decimals out to 4 places and I need to go the six


DM.dmCU.adoqCU.FieldByName('Latitude').Text;


Mark Moss
Back to top
Guillem
Guest





PostPosted: Tue Jun 13, 2006 2:39 pm    Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v Reply with quote



Mark Moss wrote:

Quote:
Ladies / Gentlemen

I am using ADO to access a MSSQL Server and when I issue the
following it only returns the decimals out to 4 places and I need to
go the six


DM.dmCU.adoqCU.FieldByName('Latitude').Text;


Mark Moss

do not use the Text property, use the AsXxx equivalent method that you
need

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
Back to top
Mark Moss
Guest





PostPosted: Tue Jun 13, 2006 9:58 pm    Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v Reply with quote



Guillem


Thanks for reminding me about '.AsFloat' etc.

BUT - I tried all of them and it is giving me me following

Stored in DataBase = '29.475256'

As Returned by FieldByName('Latitude').AsFloat = '29.4753' which
is even rounded

Any Ideas?

Mark Moss


"Guillem" <guillemvicens-nospam (AT) clubgreenoasis (DOT) com> wrote in message
news:xn0enfcpd51pj5002 (AT) newsgroups (DOT) borland.com...
Quote:
Mark Moss wrote:

Ladies / Gentlemen

I am using ADO to access a MSSQL Server and when I issue the
following it only returns the decimals out to 4 places and I need to
go the six


DM.dmCU.adoqCU.FieldByName('Latitude').Text;


Mark Moss

do not use the Text property, use the AsXxx equivalent method that you
need

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
Back to top
Brian Bushay TeamB
Guest





PostPosted: Wed Jun 14, 2006 4:59 am    Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v Reply with quote

Quote:
Ladies / Gentlemen

I am using ADO to access a MSSQL Server and when I issue the following it
only returns the decimals out to 4 places and I need to go the six


DM.dmCU.adoqCU.FieldByName('Latitude').Text;

My guess is that Delphi is treating your field as a BCD. If you want more than
4 decimals you need to change the field type to Tfloat.
See the EnableBCD property of your Tadodataset or other ADO dataset component

--
Brian Bushay (TeamB)
Bbushay (AT) NMPLS (DOT) com
Back to top
Guillem
Guest





PostPosted: Wed Jun 14, 2006 2:19 pm    Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v Reply with quote

Mark Moss wrote:

Quote:
Any Ideas?


I would try setting EnableBCD to false as Brian pointed out

--
Best regards :)

Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
--
Contribute to the Indy Docs project: http://docs.indyproject.org
--
In order to contact me remove the -nospam
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.