| View previous topic :: View next topic |
| Author |
Message |
Mark Moss Guest
|
Posted: Tue Jun 13, 2006 7:33 am Post subject: FieldByName('Latitude').Text; --- It is truncating the value |
|
|
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
|
Posted: Tue Jun 13, 2006 2:39 pm Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v |
|
|
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
|
Posted: Tue Jun 13, 2006 9:58 pm Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v |
|
|
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
|
Posted: Wed Jun 14, 2006 4:59 am Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v |
|
|
| 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
|
Posted: Wed Jun 14, 2006 2:19 pm Post subject: Re: FieldByName('Latitude').Text; --- It is truncating the v |
|
|
Mark Moss wrote:
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 |
|
 |
|