Board index » delphi » float/word mismatch

float/word mismatch

I'm using CreateTable to make a 4 field table (2 ftBCD size 6, 2 ftWord)
at run time, but I keep getting a type mismatch saying type word is
expected but type float is found. If I examine the freshly created table
with Database Desktop, the data type for the word entries is listed as
"N", which I presume is similar to float and not what I want. What am I
doing wrong?

-Ted

 

Re:float/word mismatch


I assume you are trying to create a Paradox table. Paradox tables do not
support a Word data type. You choices are float (N) or integer.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Re:float/word mismatch


Quote
>I'm using CreateTable to make a 4 field table (2 ftBCD size 6, 2 ftWord)
>at run time, but I keep getting a type mismatch saying type word is
>expected but type float is found. If I examine the freshly created table
>with Database Desktop, the data type for the word entries is listed as
>"N", which I presume is similar to float and not what I want. What am I
>doing wrong?

What kind of table are you trying to create?  Neither Paradox or dbase have a
Word field type.

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

Re:float/word mismatch


I don't have a database preferences since I'm not using anything to access my
data except my DP4 application. I selected ttDefault. What would be the best
choice?
Quote
Brian Bushay TeamB wrote:
> >I'm using CreateTable to make a 4 field table (2 ftBCD size 6, 2 ftWord)
> >at run time, but I keep getting a type mismatch saying type word is
> >expected but type float is found. If I examine the freshly created table
> >with Database Desktop, the data type for the word entries is listed as
> >"N", which I presume is similar to float and not what I want. What am I
> >doing wrong?

> What kind of table are you trying to create?  Neither Paradox or dbase have a
> Word field type.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:float/word mismatch


The simplest solution is to use an Integer field. I don't know of any
databases that support a Word field type, although I am sure they exist. If
you set a minimum value of 0 you will effectively have a Word field.

Bill

--

Bill Todd - TeamB
(TeamB cannot respond to email questions. To contact me
 for any other reason remove nospam from my address.)

Re:float/word mismatch


Quote
>I don't have a database preferences since I'm not using anything to access my
>data except my DP4 application. I selected ttDefault. What would be the best
>choice?

TTdefault will create a paradox table if you do not otherwise specify.l  But I
know of no deskstop database that supports a word field so you code won't work
as written.  Paradox supports smallint (ftSmallint) and LongInt (ftInteger)
types
You can't expect to be able to build tables if you do not know their
limitations.

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

Other Threads