📄 dbase.htm
字号:
Data Type Data Input
---- ---------- -----------------------------------------------------
C (Character) All OEM code page characters.
D (Date) Numbers and a character to separate month, day, and
year (stored internally as 8 digits in YYYYMMDD
format).
F (Floating - . 0 1 2 3 4 5 6 7 8 9
point binary
numeric)
N (Binary - . 0 1 2 3 4 5 6 7 8 9
coded decimal
numeric)
L (Logical) ? Y y N n T t F f (? when not initialized).
M (Memo) All OEM code page characters (stored internally as 10
digits representing a .DBT block number).
</PRE>
<H2>Memo Fields And .DBT Files</H2>
Memo fields store data in .DBT files consisting of blocks numbered
sequentially (0, 1, 2, and so on). SET BLOCKSIZE determines the size of
each block. The first block in the .DBT file, block 0, is the .DBT file
header.<P>
Each memo field of each record in the .DBF file contains the number of the
block (in OEM code page values) where the field's data actually begins. If
a field contains no data, the .DBF file contains blanks (20h) rather than
a number.<P>
When data is changed in a field, the block numbers may also change and the
number in the .DBF may be changed to reflect the new location.<P>
This information is from the dBASE IV Language Reference manual, Appendix
D.<P>
<H2>The data file header structure for dBASE 5.0 for DOS table file.</H2>
<PRE>
<U>The table file header:</U>
<U>Byte</U> <U>Contents</U> <U>Description</U>
0 1 byte Valid dBASE for Windows table file; bits 0-2 indicate
version number; bit 3 indicates presence of a dBASE IV
or dBASE for Windows memo file; bits 4-6 indicate the
presence of a dBASE IV SQL table; bit 7 indicates the
presence of any .DBT memo file (either a dBASE III PLUS
type or a dBASE IV or dBASE for Windows memo file).
1-3 3 bytes Date of last update; in YYMMDD format.
4-7 32-bit Number of records in the table.
number
8-9 16-bit Number of bytes in the header.
number
10-11 16-bit Number of bytes in the record.
number
12-13 2 bytes Reserved; filled with zeros.
14 1 byte Flag indicating incomplete dBASE transaction.
15 1 byte Encryption flag.
16-27 12 bytes Reserved for multi-user processing.
28 1 byte Production MDX flag; 01h stored in this byte if a prod-
uction .MDX file exists for this table; 00h if no .MDX
file exists.
29 1 byte Language driver ID.
30-31 2 bytes Reserved; filled with zeros.
32-n 32 bytes Field descriptor array (the structure of this array is
each shown below)
n+1 1 byte 0Dh stored as the field terminator.
</PRE>
n above is the last byte in the field descriptor array. The size of the
array depends on the number of fields in the table file.<P>
<PRE><U>Table Field Descriptor Bytes</U>
<U>Byte</U> <U>Contents</U> <U>Description</U>
----- -------- --------------------------------------------------------
0-10 11 bytes Field name in ASCII (zero-filled).
11 1 byte Field type in ASCII (B, C, D, F, G, L, M, or N).
12-15 4 bytes Reserved.
16 1 byte Field length in binary.
17 1 byte Field decimal count in binary.
18-19 2 bytes Reserved.
20 1 byte Work area ID.
21-30 10 bytes Reserved.
31 1 byte Production .MDX field flag; 01h if field has an index
tag in the production .MDX file; 00h if the field is not
indexed.
</PRE>
<H2>Table Records</H2>
The records follow the header in the table file. Data records are preceded
by one byte, that is, a space (20h) if the record is not deleted, an
asterisk (2Ah) if the record is deleted. Fields are packed into records
without field separators orrecord terminators. The end of the file is
marked by a single byte, with the end-of-file marker, an OEM code page
character value of 26 (1Ah). You can input OEM code page data as indicated
below.<P>
<H2>Allowable Input for dBASE Data Types</H2>
<PRE><U>Data Type</U> <U>Data Input</U>
C (Character) All OEM code page characters.
D (Date) Numbers and a character to separate month, day, and year
(stored internally as 8 digits in YYYYMMDD format).
F (Floating - . 0 1 2 3 4 5 6 7 8 9
point binary
numeric)
N (Numeric) - . 0 1 2 3 4 5 6 7 8 9
L (Logical) ? Y y N n T t F f (? when not initialized).
M (Memo) All OEM code page characters (stored internally as 10
digits representing a .DBT block number).
</PRE>
<H2>Memo Fields And .DBT Files</H2>
Memo fields store data in .DBT files consisting of blocks numbered
sequentially (0, 1, 2, and so on). SET BLOCKSIZE determines the size of
each block. The first block in the .DBT file, block 0, is the .DBT file
header.<P>
Each memo field of each record in the .DBF file contains the number of the
block (in OEM code page values) where the field's data actually begins. If
a field contains no data, the .DBF file contains blanks (20h) rather than
a number.<P>
When data is changed in a field, the block numbers may also change and the
number in the .DBF may be changed to reflect the new location.<P>
Unlike dBASE III PLUS, if you delete text in a memo field, dBASE 5.0 for
DOS may reuse the space from the deleted text when you input new text.
dBASE III PLUS always appends new text to the end of the .DBT file. In
dBASE III PLUS, the .DBT file size grows whenever new text is added, even
if other text in the file is deleted.<P>
This information is from the dBASE for DOS Language Reference manual,
Appendix C.<P>
<H2>The data file header structure for dBASE 5.0 for Windows table file.</H2>
<PRE><U>The table file header:</U>
<U>Byte</U> <U>Contents</U> <U>Description</U>
0 1 byte Valid dBASE for Windows table file; bits 0-2 indicate
version number; bit 3 indicates presence of a dBASE IV
or dBASE for Windows memo file; bits 4-6 indicate the
presence of a dBASE IV SQL table; bit 7 indicates the
presence of any .DBT memo file (either a dBASE III PLUS
type or a dBASE IV or dBASE for Windows memo file).
1-3 3 bytes Date of last update; in YYMMDD format.
4-7 32-bit Number of records in the table.
number
8-9 16-bit Number of bytes in the header.
number
10-11 16-bit Number of bytes in the record.
number
12-13 2 bytes Reserved; filled with zeros.
14 1 byte Flag indicating incomplete dBASE IV transaction.
15 1 byte dBASE IV encryption flag.
16-27 12 bytes Reserved for multi-user processing.
28 1 byte Production MDX flag; 01h stored in this byte if a prod-
uction .MDX file exists for this table; 00h if no .MDX
file exists.
29 1 byte Language driver ID.
30-31 2 bytes Reserved; filled with zeros.
32-n 32 bytes Field descriptor array (the structure of this array is
each shown below)
n+1 1 byte 0Dh stored as the field terminator.
</PRE>
n above is the last byte in the field descriptor array. The size of the
array depends on the number of fields in the table file.<P>
<PRE><U>Table Field Descriptor Bytes</U>
<U>Byte</U> <U>Contents</U> <U>Description</U>
0-10 11 bytes Field name in ASCII (zero-filled).
11 1 byte Field type in ASCII (B, C, D, F, G, L, M, or N).
12-15 4 bytes Reserved.
16 1 byte Field length in binary.
17 1 byte Field decimal count in binary.
18-19 2 bytes Reserved.
20 1 byte Work area ID.
21-30 10 bytes Reserved.
31 1 byte Production .MDX field flag; 01h if field has an index
tag in the production .MDX file; 00h if the field is not
indexed.
</PRE>
<H2>Table Records</H2>
The records follow the header in the table file. Data records are preceded
by one byte, that is, a space (20h) if the record is not deleted, an
asterisk (2Ah) if the record is deleted. Fields are packed into records
without field separators orrecord terminators. The end of the file is
marked by a single byte, with the end-of-file marker, an OEM code page
character value of 26 (1Ah). You can input OEM code page data as indicated
below.<P>
<PRE><U>Allowable Input for dBASE Data Types</U>
<U>Data Type</U> <U>Data Input</U>
B (Binary) All OEM code page characters (stored internally as 10
digits representing a .DBT block number).
C (Character) All OEM code page characters.
D (Date) Numbers and a character to separate month, day, and year
(stored internally as 8 digits in YYYYMMDD format).
G (General All OEM code page characters (stored internally as 10
digits or OLE) representing a .DBT block number).
N (Numeric) - . 0 1 2 3 4 5 6 7 8 9
L (Logical) ? Y y N n T t F f (? when not initialized).
M (Memo) All OEM code page characters (stored internally as 10
digits representing a .DBT block number).
</PRE>
<H2>Binary, Memo, and OLE Fields And .DBT Files</H2>
Binary, memo, and OLE fields store data in .DBT files consisting of blocks
numbered sequentially (0, 1, 2, and so on). SET BLOCKSIZE determines the
size of each block. The first block in the .DBT file, block 0, is the .DBT
file header.<P>
Each binary, memo, or OLE field of each record in the .DBF file contains
the number of the block (in OEM code page values) where the field's data
actually begins. If a field contains no data, the .DBF file contains
blanks (20h) rather than a number.<P>
When data is changed in a field, the block numbers may also change and the
number in the .DBF may be changed to reflect the new location.<P>
Unlike dBASE III PLUS, if you delete text in a memo field (or binary and
OLE fields), dBASE for Windows (unlike dBASE IV) may reuse the space from
the deleted text when you input new text. dBASE III PLUS always appends
new text to the end of the .DBT file. In dBASE III PLUS, the .DBT file
size grows whenever new text is added, even if other text in the file is
deleted.<P>
This information is from the dBASE for Windows Language Reference manual,
Appendix C.<P>
<FONT SIZE="2"><HR>
DISCLAIMER: You have the right to use this technical information subject
to the terms of the No-Nonsense License Statement that you received with
the Borland product to which this information pertains.
<HR>
</FONT>
<HR SIZE="6" COLOR="LIME">
<FONT SIZE="2">
<a href="mailto:rdb@ktibv.nl">Please email me</a> and tell me if you liked this page.<BR>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.write("Last modified " + document.lastModified);
// -->
</SCRIPT><P>
<TABLE BORDER=0 ALIGN="CENTER">
<TR>
<TD>This page has been created with </TD>
<TD> <A HREF="http://www.dexnet.com./homesite.html"><IMG SRC="../images/hs25ani.gif" WIDTH=88 HEIGHT=31 BORDER=0 ALT="HomeSite 2.5b">
</A></TD>
</TR>
</TABLE>
</FONT>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -