Board index » delphi » sure its been done b4

sure its been done b4

Please point me to the right direction.

dbase Table.CreateTable

using FieldDefs.Add('Astring', ftString, 11, false)
   results in 11 character wide field. (great, expected that)

using FieldDefs.Add('Adate', ftDate, 0, false)
   results in 8 character date type field. (ok, but don't know why)

using FieldDefs.Add('Anumber', ftFloat, 0, false)
   result in 20 digit numeric field with 4 decimal places (not even legal)

Now my question: How do I create a table with numeric fields of a specific
size and precision?

your help is greatly appreciated!

--
Charles Lam
Asst. DP Manager
The Personal Marketing Company
Charles AT Tpmco Dot Com

 

Re:sure its been done b4


Charles,

Quote
>using FieldDefs.Add('Anumber', ftFloat, 0, false)
>   result in 20 digit numeric field with 4 decimal places (not even legal)

>Now my question: How do I create a table with numeric fields of a specific
>size and precision?

Use SQL to create the table where you can specify the size and precision.

---------------------------------------
Terry Swiers
Millennium Software, LLC

Atrex Inventory Control/POS -
   '96, '97, '98 - Ziff-Davis/PC Magazine Shareware Award Finalist

http://www.1000years.com

---------------------------------------

Re:sure its been done b4


Terry, Thanks for you fast post. When I execSQL I get a DB not a DBF. I
assume I now need a database and specify driver, since there is not a table
type property in a tQuery. Any more info would be appreciated.

Thanks!

--
Charles Lam
Asst. DP Manager
The Personal Marketing Company
Charles AT Tpmco Dot Com

Quote
Terry Swiers wrote in message <782lf7$bt...@forums.borland.com>...

>Charles,

>>using FieldDefs.Add('Anumber', ftFloat, 0, false)
>>   result in 20 digit numeric field with 4 decimal places (not even legal)

>>Now my question: How do I create a table with numeric fields of a specific
>>size and precision?

>Use SQL to create the table where you can specify the size and precision.

>---------------------------------------
>Terry Swiers
>Millennium Software, LLC

>Atrex Inventory Control/POS -
>   '96, '97, '98 - Ziff-Davis/PC Magazine Shareware Award Finalist

>http://www.1000years.com

>---------------------------------------

Re:sure its been done b4


Great! Thanks!

--
Charles Lam
Asst. DP Manager
The Personal Marketing Company
Charles AT Tpmco Dot Com

Quote
Terry Swiers wrote in message <782pml$c...@forums.borland.com>...
>Charles,

>>Terry, Thanks for you fast post. When I execSQL I get a DB not a DBF. I
>>assume I now need a database and specify driver, since there is not a
table
>>type property in a tQuery. Any more info would be appreciated.

>CREATE TABLE "emp.dbf" ( last_name CHAR(20),  first_name CHAR(15) )

>If you specify the extension it should create a dBase table.  I tested this
>against an alias that was set to Paradox for the default driver and it
>created a dBase table without any problem.

>---------------------------------------
>Terry Swiers
>Millennium Software, LLC

>Atrex Inventory Control/POS -
>   '96, '97, '98 - Ziff-Davis/PC Magazine Shareware Award Finalist

>http://www.1000years.com

>---------------------------------------

Re:sure its been done b4


Charles,

Quote
>Terry, Thanks for you fast post. When I execSQL I get a DB not a DBF. I
>assume I now need a database and specify driver, since there is not a table
>type property in a tQuery. Any more info would be appreciated.

CREATE TABLE "emp.dbf" ( last_name CHAR(20),  first_name CHAR(15) )

If you specify the extension it should create a dBase table.  I tested this
against an alias that was set to Paradox for the default driver and it
created a dBase table without any problem.

---------------------------------------
Terry Swiers
Millennium Software, LLC

Atrex Inventory Control/POS -
   '96, '97, '98 - Ziff-Davis/PC Magazine Shareware Award Finalist

http://www.1000years.com

---------------------------------------

Re:sure its been done b4


Quote
On Tue, 19 Jan 1999 13:03:36 -0600, Charles Lam wrote:
> using FieldDefs.Add('Adate', ftDate, 0, false)
>    results in 8 character date type field. (ok, but don't know why)

DBF's always store date type field data as an 8 character field:

CCYYMMDD such that today would be 19990119

Gary

Some dBASE Stuff at
http://www.AppTools.com/dbase

Other Threads