`
iihero
  • 浏览: 254957 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

jdbf中试图支持Foxpro的dbf数据类型

阅读更多

今天下午在更新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 <!-- Numeric -->
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.

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)
分享到:
评论

相关推荐

    两个foxpro的dbf表的比较

    这些字段定义了数据的结构,比如数据类型(数值、字符、日期等)和长度。 标题"两个foxpro的dbf表的比较"暗示我们要比较的是两个具有相同结构的DBF表,这意味着它们有相同的字段布局和相同数量的字段。这种比较通常...

    DBF java 操作 dbf foxpro 例子

    在IT行业中,数据库文件格式是数据存储和交换的重要方式之一,DBF文件就是其中一种常见的格式,它最初由FoxPro数据库管理系统使用。本篇将详细探讨如何使用Java操作DBF文件,以及涉及到的相关知识点。 首先,DBF...

    javadbf.jar jdbf.jar将数据库数据直接转为dbf格式的文件

    2. **写入数据**:将数据库记录插入到DBF文件中,支持多种数据类型,包括数值、字符串、日期等。 3. **读取数据**:从DBF文件中检索记录,可以进行查询和遍历操作。 4. **更新和删除记录**:对已存在的DBF文件进行...

    将 Excel工作表 转换成 FoxPro 的 dbf 格式

    3. VisualFoxPro数据类型和字段类型.png:此图可能展示了FoxPro支持的数据类型和字段类型,这对于理解如何在Excel中预设数据格式以匹配dbf的要求是至关重要的。 4. Excel转dbf攻略秘笈.xls:这是一个Excel文件,很...

    c#从SQL server传输数据到FOXPRO的DBF表

    用C#写的从SQL server传输数据到FOXPRO的DBF表,就是将SQLserver里有两个表里的最新卡号插入到foxpro的DBF表文件里,里面用到了读写ini配置文件,还有判断数据库里的最新记录和用c#操作Foxpro数据库,希望能对您有所...

    dbf解决中文乱码

    DBF文件是Dbase格式的数据库文件,常见于早期的桌面数据库系统中,如FoxPro、Visual FoxPro等。在处理包含中文字符的DBF文件时,可能会遇到中文乱码的问题,这通常与编码设置不匹配有关。以下是一些关于解决DBF文件...

    java dbf jdbf foxpro 读取类

    一个类搞定 dbf文件读取,方便又卫生,老少皆宜

    DBF数据源驱动

    DBF文件是早期的数据库文件格式,常见于FoxPro、Visual FoxPro等系统中,它们包含了结构化的表格数据。在现代环境中,尽管SQL数据库如Oracle已广泛使用,但处理遗留的DBF数据仍有时必要。 Oracle数据源驱动,另一...

    Foxpro DBF数据库转换成SQL Server6.5表的几种方法.pdf

    Microsoft Access提供了DBF文件的导入导出功能,并且支持数据与SQL Server的链接。可以先将DBF数据导入Access数据库,然后通过Access提供的数据转换工具或编写宏命令,将数据再导出到SQL Server表中。这种方法比较...

    java操作FoxPro之jdbf.jar的源代码

    2. **记录操作**:支持遍历DBF文件的每一行记录,读取和设置字段值,同时处理各种数据类型,如字符串、数字、日期等。 3. **文件写入**:允许创建新的DBF文件,或者向现有文件添加、更新或删除记录。这通常涉及文件...

    FoxPro DBF数据库转换成SQL Server 2000表的几种方法.pdf

    随着客户机/服务器体系结构的数据库系统如SQL Server、Oracle、Sybase等的广泛采用,如何将过去常用的FoxPro DBF数据库迁移到这些现代数据库系统,特别是迁移到SQL Server 2000表中,已经成为了一项重要的数据处理...

    dbf转sql工具 支持foxpro VF数据库

    DBF转SQL工具是一款专为处理FOXPRO和Visual FoxPro(VF)数据库设计的应用程序,它使得用户能够将这些老版本的DBF文件转换成SQL格式,以便在更现代的数据库管理系统中使用或进行数据迁移。这个过程对于那些需要升级...

    完整版读取DBF数据.rar

    DBF(dBase File)是一种常见的数据库文件格式,最初由dBase系统引入,现在被许多其他数据库管理系统支持,包括Visual FoxPro、 Clipper 和 Microsoft Access等。这种文件格式存储表格数据,每个DBF文件通常包含表格...

    java快速导出几十万百万生成DBF文件数据后台内附有javadbf.jar

    2. **创建DBF表结构**: 使用库提供的API定义DBF文件的字段,包括字段名、数据类型和长度。 3. **写入数据**: 创建DBFWriter对象,然后逐行写入数据。对于大量数据,可能需要批量写入,以减少频繁的磁盘I/O操作。 4...

    DBF文件合并

    DBF文件是Dbase格式的数据库文件,常见于早期的桌面数据库管理系统中,如FoxPro、Visual FoxPro等。这种格式在处理结构化数据时非常方便,尤其在一些老系统的数据存储中仍然广泛使用。当你需要处理多个同名的DBF文件...

    Foxpro数据查看器

    Foxpro数据查看器是一款专为处理FoxPro数据库文件设计的工具,它允许用户方便地查看、管理和分析存储在这些文件中的数据。FoxPro是一种早期的数据库管理系统,由Microsoft开发,广泛应用于上世纪90年代的数据存储和...

    ASP 读取 DBF 数据文件

    在ASP中,我们可以使用ADO(ActiveX Data Objects)来连接和操作各种类型的数据源,包括DBF(FoxPro)数据库文件。DBF是Visual FoxPro、dBASE等数据库管理系统中常用的一种文件格式,存储结构化数据。 在ASP中读取...

    读取DBF数据.rar

    2. **数据类型**:DBF支持多种数据类型,例如数值型(N)、字符型(C)、日期型(D)、逻辑型(L)等。理解这些数据类型对于正确解析文件至关重要。 3. **API和库**:多种编程语言提供了读取DBF文件的库和API,例如...

    利用ADO控件连接DBF数据表

    在Delphi这个强大的RAD(快速应用程序开发)环境中,我们可以利用其内置的ADO(ActiveX Data Objects)控件来方便地连接和操作各种类型的数据源,包括经典的DBF(dBASE格式)文件。本教程将详细介绍如何通过ADO控件...

Global site tag (gtag.js) - Google Analytics