今天下午在更新jdbf包的时候,发现它对foxpro的dbf文件格式支持非常有限。
在我的jdbf包里,只支持C, N, L, D, F五种类型,我试图扩充I (Integer)类型,几本上能通过。
可是在扩充M(Memo), Y(Currency), T(Datetime)类型时,由于不知道它到底是怎么存储的,程序出错。
如果时间充足,借助于hex dump工具,也许能分析出这几种类型在foxpro里是怎么存储的。sigh, 微软都快要放弃foxpro了,为什么格式还那么保密呢。
Code Type Length Description
C | Character | < 254 |
ASCII text < 254 characters long in dBASE. Character fields can be up to 32 KB long (in Clipper and FoxPro) using decimal count as high byte in field length. It's possible to use up to 64KB long fields by reading length as unsigned. Only fields <= 100 characters can be indexed.
|
<!-- Numeric -->N | Number | <18 | ASCII text up till 18 characters long (include sign and decimal point). Valid characters: "0" - "9" and "-". Number fields can be up to 20 characters long in FoxPro and Clipper. |
L | Logical | 1 | Boolean/byte (8 bit) Legal values:
|
? | Not initialised (default) | |
Y,y | Yes |
N,n | No |
F,f | False |
T,t | True |
Logical fields are always displayed using T/F/?. Some sources claims that space (ASCII 20h) is valid for not initialised. Space may occur, but is not defined. | |
|
D | Date | 8 | Date in format YYYYMMDD. A date like 0000-00- 00 is *NOT* valid. |
M | Memo | 10 | Pointer to ASCII text field in memo file 10 digits representing a pointer to a DBT block (default is blanks). |
F | Floating point | 20 | (dBASE IV and later, FoxPro, Clipper) 20 digits |
N/A | Character name variable | < 254 | 1-254 characters (64 KB in FoxBase and Clipper) |
B | Binary | ?? | (dBASE V) Like Memo fields, but not for text processing. (FoxPro/FoxBase) Double integer *NOT* a memo field
|
G | General | ?? | (dBASE V: like Memo) OLE Objects in MS Windows versions |
P | Picture | ?? | (FoxPro) Like Memo fields, but not for text processing. |
Y | Currency | ?? | (FoxPro) |
T | DateTime | ?? | (FoxPro) |
I | Integer | 4 byte little endian integer | (FoxPro) |
V | VariField | 2-10 bytes | There are weakly-typed and strongly-typed VariFields. Weakly-typed VariFields allow to store a portion of any character data in the .DBF field itself, with any additional amount, if any, being automatically stored in the MEMO file. This substantially reduces the amount of disk space required to store the data. This is sort of a cross between using a CHARACTER field and a MEMO field at the same time.
A 6 byte pointer is maintained at the end of the weakly-typed "V" field entry within the DBF file. When you define the field width for a new database file, keep in mind that weakly-typed "V" fields require this additional 6 bytes at the end.
Strongly-typed VariFields store DATE values in only three bytes, instead of eight, and LONG INTEGER values (up to ~2G) in only 4 bytes. Any "V" field defined with 4 bytes is automatically considered a strongly-typed integer, and "V" fields defined with 3 bytes are automatically considered strongly-typed DATE values. No additional space is required (6- byte pointer) for strongly typed VariFields. FlagShip has additional types V 10 Variable Variable, bin/asc data in .dbv (.dbf type = 0xB3)
4bytes bin= start pos in memo
4bytes bin= block size
1byte = subtype
1byte = reserved (0x1a)
10spaces if no entry in .dbv
2 2 short int binary int max +/- 32767 (.dbf type = 0xB3)
4 4 long int binary int max +/- 2147483647 (.dbf type = 0xB3)
8 8 double binary signed double IEEE (.dbf type = 0xB3)
|
X | Variant (X) for compatibility with SQL-s (i.e. varChar). | | (CLIP) |
@ | Timestamp. | 8 bytes (two longs) | First long repecents date and second long time. Date is the number of days since January 1st, 4713 BC. Time is hours * 3600000L + minutes * 60000L + seconds * 1000L. |
O | Double | 8 bytes | (no conversion) |
+ | Autoincrement | long | (no conversion) |
<script type="text/javascript"><!--
google_ad_client = "ca-pub-7104628658411459";
/* wide1 */
google_ad_slot = "8564482570";
google_ad_width = 728;
google_ad_height = 90;
//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
分享到:
相关推荐
用C#写的从SQL server传输数据到FOXPRO的DBF表,就是将SQLserver里有两个表里的最新卡号插入到foxpro的DBF表文件里,里面用到了读写ini配置文件,还有判断数据库里的最新记录和用c#操作Foxpro数据库,希望能对您有所...
一个类搞定 dbf文件读取,方便又卫生,老少皆宜
NULL 博文链接:https://vernonchen163.iteye.com/blog/2037821
javadbf.jar jdbf.jar将数据库数据直接转为dbf格式的文件
对两个结构相同,并且含有两个以上相同字段的dbf表进行比较。
Foxpro DBF数据库转换成SQL Server6.5表的几种方法.pdf
FoxPro DBF数据库转换成SQL Server 2000表的几种方法.pdf
dbf转sql工具 支持foxpro老版本的dbf文件以及vf的dbf文件,方便转换
DBF解压程序.适合大多数DBF数据文件
完整版读取DBF数据.rar
通过Visual FoxPro Ole DBProvider连接DBF数据,需要先按照VFPOLEDB.1驱动,可以去微软网站下载。使用Datagirdview显示数据。 本代码是项目中的一块,本人验证无误!
ASP连接和读取DBF数据文件。 conn.open "Driver={Microsoft FoxPro VFP Dr***********
将 Excel工作表 转换成 dbf自由表,这个软件最好用、最专业。 最强的是:该软件支持 xls 和 xlsx 两种格式,转换为 dbf
Excel与DBF数据的读取与写入
移植到了C#下,开发环境.net 2005,由于时间问题,只实现了读写和查询功能,以及对文件的独占判断,没有实现删除和新增功能,对数据的写入完全基于流字节写入,没有对数据类型做过多的判断(个人认为这些判断可以省略...
VO, DB2K...)编辑和浏览工具,您能够编辑、分类、查询和删除副本、创建打印数据库表格,支持输出DBF, TXT, CSV, Excel, HTML, XML, PRG, SQL多种格式,同时也支持编辑和浏览dBase III, dBase IV, FoxPro, VFP 和 ...
封装了大数据DBF的读取、写入,并附有所使用javadbf.jar文件
读取DBF数据.rar 读取DBF数据.rar 读取DBF数据.rar 读取DBF数据.rar 读取DBF数据.rar 读取DBF数据.rar
DBF文件 概括 在Node.js中读写.dbf(dBase III和Visual FoxPro)文件: 支持的字段类型: C (字串) N (数字) F (浮点) I (整数) ...可以将记录追加到现有的.dbf文件中支持超大文件 可以指
1.支持 Clipper/FoxPro/VFP/DB2K DBF文件格式 2.支持超过2GB的DBF文件 3.自动检测数据表和字符集 4.自动关联.DBF文件 5.快速浏览 6.支持通配符查询 7.快速删除重复记录 8.记录浏览方式 9.创建、修改和打印dbf文件...