dbTalk Databases Forums  

A couple of easy questions!

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss A couple of easy questions! in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael J Davis
 
Posts: n/a

Default A couple of easy questions! - 08-16-2005 , 07:00 AM








We're *still* using VPF 3.0b (feel I should apologise!)

We've had no end of problems getting some recent data from Access to
VPF. Turns out that the Access table had more than 2K characters per
record. I know the old dBase III/IV format doesn't store data the same
way as Access, but I can't find the upper limit for a record in either
FOX2 or VPF formats.

Q1. Is there any?

On this matter of data transfer, we regularly forget to convert data
from VPF to Fox2 format before transferring data to 3rd parties.
(Amazingly VPF format is not recognised by Access!) At present I either
have to ensure it is copied to a new file TYPE FOX2, or try to open it
in another program that doesn't recognise VPF. (Like Excel, Access, or
FoxPro2!!)

Q2. Is there a simple way of asking VPF what format a *.dbf file is in?

Thanks

Mike
[The reply-to address is valid for 30 days from this posting]
--
Michael J Davis
<><
Some newsgroup contributors appear to have confused
the meaning of "discussion" with "digression".
<><

Reply With Quote
  #2  
Old   
Rick Bean
 
Posts: n/a

Default Re: A couple of easy questions! - 08-16-2005 , 09:53 AM






Michael,
According to the help file:
Maximum # of characters per record.
65,500

This assumes 254 (or 255 depending on wheter NULL values are allowed) fields
and all the fields are character with a width of 254. Obviously it can be
reduced if there are non character fields. However it can be greatly increased
if you use Memo fields as this data is stored in a separate data file.

A Simplfied version of the DBF follows:
************************************************** ***************************************
* Table Header Record Structure
* Byte offset Description
* 0 File type:
* 0x02 FoxBASE
* 0x03 FoxBASE+/Dbase III plus, no memo
* 0x30 Visual FoxPro
* 0x31 Visual FoxPro, autoincrement enabled
* 0x43 dBASE IV SQL table files, no memo
* 0x63 dBASE IV SQL system files, no memo
* 0x83 FoxBASE+/dBASE III PLUS, with memo
* 0x8B dBASE IV with memo
* 0xCB dBASE IV SQL table files, with memo
* 0xF5 FoxPro 2.x (or earlier) with memo
* 0xFB FoxBASE
* 1 - 3 Last update (YYMMDD)
* 4 - 7 Number of records in file
* 8 - 9 Position of first data record
* Please note that the position of the first data record is a
number where 0 is the fist byte, so for use with (V)FP
* 1 should be added to this number
* 10 - 11 Length of one data record, including delete flag
* 12 - 27 Reserved
* 28 Table flags:
* 0x01 file has a structural .cdx
* 0x02 file has a Memo field
* 0x04 file is a database (.dbc)
* This byte can contain the sum of any of the above values. For example, the
value 0x03 indicates
* the table has a structural .cdx and a Memo field.
* 29 Code page mark
* 30 - 31 Reserved, contains 0x00
* 32 - n Field subrecords, see Field Subrecords Structure below
* The number of fields determines the number of field subrecords. One field
subrecord exists for
* each field in the table.
* n+1 Header record terminator (0x0D)
* The following is only true for Visual Foxpro tables.
* n+2 to n+264 A 263-byte range that contains the backlink, which is the
relative path of an associated
* database (.dbc) file, information. If the first *byte is 0x00,
the file is not associated
* with a database. Therefore, database files always contain 0x00.
************************************************** ****************************************
* Field Subrecords Structure
* Byte offset Description
* 0 - 10 Field name with a maximum of 10 characters. If less than 10,
* it is padded with null characters (0x00).
* 11 Field type:
* C - Character
* Y - Currency Visual Foxpro
* N - Numeric Visual Foxpro
* F - Float Visual Foxpro
* D - Date
* T - DateTime Visual Foxpro
* B - Double Visual Foxpro
* I - Integer Visual Foxpro
* L - Logical
* M - Memo
* G - General Visual Foxpro
* C - Character (binary) Visual Foxpro
* M - Memo (binary) Visual Foxpro
* P - Picture Visual Foxpro
* 12 - 15 Displacement of field in record
* 16 Length of field (in bytes)
* 17 Number of decimal places
* 18 Field flags: Visual Foxpro
* 0x01 System Column (not visible to user)
* 0x02 Column can store null values
* 0x04 Binary column (for CHAR and MEMO only)
* 0x06 (0x02+0x04) When a field is NULL and binary (Integer,
Currency, and Character/Memo fields)
* 0x0C Column is autoincrementing
* 19 - 22 Value of autoincrement Next value Visual Foxpro 8 and
higher
* 23 Value of autoincrement Step value Visual Foxpro 8 and
higher
* 24 - 31 Reserved
*
************************************************** ************************************
*
* In (Visual) Foxpro arrays start with 1 so add 1 to the numbers
* in the structure info above in order to get the info with (Visual) Foxpro
programs
* So the first 32 bytes contain the info
* Each field adds another 32 bytes to the header
*
************************************************** ************************************

Rick

"Michael J Davis" <?.?@trustsof.demon.co.uk> wrote

Quote:

We're *still* using VPF 3.0b (feel I should apologise!)

We've had no end of problems getting some recent data from Access to VPF.
Turns out that the Access table had more than 2K characters per record. I know
the old dBase III/IV format doesn't store data the same way as Access, but I
can't find the upper limit for a record in either FOX2 or VPF formats.

Q1. Is there any?

On this matter of data transfer, we regularly forget to convert data from VPF
to Fox2 format before transferring data to 3rd parties. (Amazingly VPF format
is not recognised by Access!) At present I either have to ensure it is copied
to a new file TYPE FOX2, or try to open it in another program that doesn't
recognise VPF. (Like Excel, Access, or FoxPro2!!)

Q2. Is there a simple way of asking VPF what format a *.dbf file is in?

Thanks

Mike
[The reply-to address is valid for 30 days from this posting]
--
Michael J Davis

Some newsgroup contributors appear to have confused
the meaning of "discussion" with "digression".



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.