Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Field.DataType??

0 views
Skip to first unread message

Pierre Demers

unread,
Apr 26, 2000, 3:00:00 AM4/26/00
to
Hi everyone,

I am getting a false result when I try to get the datatype on a integer
field on a dbase IV table. Instead of giving me the ftInteger type, it
brings me the ftFloat type. Eventhough when I made the table, I use the
ftInteger type. And when I look at the field through the DBD32 it shows N 11
0? What is the catch here?

Thanks
Pierre

Brian Bushay TeamB

unread,
Apr 27, 2000, 3:00:00 AM4/27/00
to

Dbase 7 tables support a true integer field type. Prior dbase table versions
used a number field when you specified an integer. The version of BDE you are
using only recognizes the true Integer field in dbase 7 tables as the Ftinteger
type.


--
Brian Bushay (TeamB)
Bbu...@NMPLS.com

Jan Sprengers

unread,
Apr 27, 2000, 3:00:00 AM4/27/00
to
On Wed, 26 Apr 2000 13:36:41 -0400, "Pierre Demers"
<dem...@hotmail.com> wrote:

>I am getting a false result when I try to get the datatype on a integer
>field on a dbase IV table. Instead of giving me the ftInteger type, it
>brings me the ftFloat type. Eventhough when I made the table, I use the
>ftInteger type. And when I look at the field through the DBD32 it shows N 11
>0? What is the catch here?

It's quite logical actually. The essence of a database is to keep the
data it is supposed to contain. When you tell the BDE that you want
the logical field type fldINT32, it will translate this into a
physical field type of the target database that is large enough to
contain all possible values.

For a 32-bit integer, this means it can contain a value from
-2147483648 to 2147483647 and since this is stored in ASCII in the
dBase IV numeric field type, it needs 11 positions to be able to store
'-2147483648'. However, you can dictate what field length and
decimals you want by using the ftBCD field type to create your table
structure.

When Delphi accesses this field, the physical field type is
retranslated to a logical field type. This is always an ftFloat field
for a dBase numeric field, unless the field length is less then 5
digits and there are no decimal places; in that case it will be
translated into an ftSmallInt field.

HTH,

Jan


Pierre Demers

unread,
Apr 27, 2000, 3:00:00 AM4/27/00
to
Thanks everyone, your help is really appreciate.
Best regards
Pierre

Pierre Demers <dem...@hotmail.com> a écrit dans le message :
8e78k9$2a...@bornews.borland.com...
> Hi everyone,


>
> I am getting a false result when I try to get the datatype on a integer
> field on a dbase IV table. Instead of giving me the ftInteger type, it
> brings me the ftFloat type. Eventhough when I made the table, I use the
> ftInteger type. And when I look at the field through the DBD32 it shows N
11
> 0? What is the catch here?
>

> Thanks
> Pierre
>
>

0 new messages