delphi 连接DBF

使用 DBF 文件时,文件夹表示数据库,单个 DBF 文件表示表

1、BDE,已淘汰

table1.Databasename:=dbdir;//设置库路径
table1.TableName:=dbname;

2、ADO

1)用Microsoft jet4.0驱动字符串,大多数机器都安装了,可用

2)Microsoft Visual FoxProDriver驱动,需要下载安装

https://docs.microsoft.com/en-us/sql/odbc/microsoft/visual-foxpro-odbc-driver

https://support.microsoft.com/en-us/help/277772/visual-foxpro-odbc-driver-not-included-in-mdac-2.6-and-later

连接字符串格式如下:

PROVIDER=MSDASQL;DRIVER={Microsoft Visual Foxpro Driver};SourceDB=%S;SourceType=DBF

3)Visual FoxPro OLE DB provider

ADOConstr =
                "Provider=VFPOLEDB.1;Data Source=%s;Mode=Share Deny None;Extended Properties=;Collating Sequence=MACHINE";

      Microsoft OLE DB Provider for Visual FoxPro 9.0 下载地址2017.4.20

https://www.microsoft.com/en-us/download/details.aspx?id=14839

VFPOLEDBSetup.msi,安装后DBF问题都可以解决,突破dbase里的单行4000字节的限制。

setup path

C:\Program Files (x86)\Microsoft Visual FoxPro OLE DB Provider\

3、ADS(Advantage Database Server)

DriverID=ADS Database=c:\ads\data TableType=VFP

http://docs.embarcadero.com/products/rad_studio/firedac/frames.html?frmname=topic&frmfile=Connect_to_Advantage_Database_Server.html

微软官方不建议用Visual FoxPro ODBC Driver,官方声明如下。代替的是Visual FoxPro OLE DB provider

https://msdn.microsoft.com/en-us/library/mt490121

Visual FoxPro ODBC Driver
The VFPODBC driver is no longer supported.
We strongly recommend using the Visual FoxPro OLE DB provider as a
replacement. Please refer to the following article for more information
and related links to issues when using the VFPODBC driver: http://support.microsoft.com/kb/277772.

ADO连接DBF的连接字符串

Provider = Microsoft.Jet.OLEDB.4.0 ;Data Source ={0};Extended Properties=dBASE IV
Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=%s;Extended Properties=dbase 5.0;Persist Security Info=True

每行记录中字符的最大数目 65,500
每行记录中字段的最大数目 255
每个字段中字符数的最大值 254

create table 的时候,80个字段成功,81个字段就报错。有36个字段的类型varchar(200)。是不是太宽了。

字段将不能置于记录中

某个字段类型宽度太大的原因?字段没有超过255的varchar(255),这个原因不存在.

20个varchar(200)可以创建成功,第21个字段即使是1个字节varchar(1)也不成功。

把第20个改成varchar(201),不要第21个字段,也是报错。20个varchar(200)成功建表。证明200*200=4000是上限。这是为何?

如果4000个字节是上限,那么版本是什么dbase?

实验200个字段可以创建成功char(1),那就说明字段数上限不是128.

dBASE III 和 IV DBF 格式

DBF规范dBASE III

最大字段数为 128
每个字段最多包含 254 个字符
每个记录最多包含 4000 个字节

http://www.dof.ca.gov/Accounting/CALSTARS/Monarch/Monarch_System_Specifications/

http://johnbrown.com.au/approach/webfaq04040210.html

  • maximum file size = 2 gigabytes (per type .dbf or .dbt file)
  • maximum records per database = 1,000,000,000 (1 billion)
  • maximum of 30 open dBaseIV databases on a single computer
  • maximum number of fields per record = 255
  • maximum size of a record = 4000 characters (= all the field-lengths added together)

BDE DBF

http://www.delphigroups.info/2/81/365949.html

dBASE Limitations
256 Open dBASE tables per system (16 Bit)
350 Open dBASE tables per system (BDE 3.0 - 4.0, 32 Bit)
512 Open dBASE tables per system (BDE 4.01, 32 Bit) (NEW BDE 4.01)
100 Record locks on one dBASE table (16 and 32 Bit)
100 Records in transactions on a dBASE table (32 Bit)
1 Billion records in a table
2 Billion bytes in .DBF (Table) file
4000 Size in bytes per record (dBASE 4)
32767 Size in bytes per record (dBASE for Windows)
255 Number of fields per table (dBASE 4)
1024 Number of fields per table (dBASE for Windows)
47 Number of index tags per .MDX file
254 Size of character fields
10 Open master indexes (.MDX) per table
220 Key expression length in characters

http://edn.embarcadero.com/article/15159

DBASE LIMITS
256      Open dBASE tables per system (16 Bit)
350      Open dBASE tables per system (BDE 3.0 - 4.0,32 Bit)
512      Open dBASE tables per system (BDE 4.01, 32 Bit)
100      Record locks on one dBASE table  (16 and 32 Bit)
100      Records in transactions on a dBASE table (32 Bit)
1      Billion records in a table
2      Billion bytes in .DBF (Table) file
4000      Size in bytes per record (dBASE 4)
32767      Size in bytes per record (dBASE for Windows)
255      Number of fields per table (dBASE 4)
1024      Number of fields per table (dBASE for Windows)
47      Number of index tags per .MDX file
254      Size of character fields
10      Open master indexes (.MDX) per table
220      Key expression length in characters

http://www.dbase.com/help/BDE_Limits/IDH_BDE_LIMITS.htm

delphi 连接DBF的更多相关文章

  1. Delphi连接Oracle控件ODAC的安装及使用(轉載)

     Delphi连接Oracle控件ODAC的安装及使用 2010-08-13 01:13:37 标签:Oracle Delphi 控件 休闲 ODAC 原创作品,允许转载,转载时请务必以超链接形式标明 ...

  2. delphi 连接mysql

    Delphi连接MySQL真麻烦,研究了一天,从网上找了无数文章,下载了无数插件都没解决.最后返璞归真,老老实实用ADO来连接,发现也不是很顺利,但最终还是连接成功了.多少有点心得:ADO各个组件的作 ...

  3. delphi 连接 c++ builder 生成obj文件

    delphi 连接 c++ builder 生成obj文件 delphi 可以连接c++ builder 生成OMF格式的obj文件,会报一个错.[DCC Error] E2065 Unsatisfi ...

  4. 遇到delphi连接sql一个奇怪的问题:未指定的错误,加大了命令的等待时间为600即可了

    遇到delphi连接sql一个奇怪的问题:未指定的错误,加大了命令的等待时间为600即可了 找了一下午没解决.

  5. delphi连接sql server的字符串2011-10-11 16:07

    delphi连接sql server的字符串2011-10-11 16:07 一.delphi连接sql server 放一个连接组件 ADOConnection, 其它组件TADODataSet,T ...

  6. Delphi连接Oracle控件ODAC的安装及使用

    Delphi连接Oracle有很多种方式,但大多要在客户机上安装Oracle那庞大的客户端,比较不方便,使用ODAC控件连接Oracle则免去了这些麻烦.ODAC也是Oracle公司载发的控件.有fo ...

  7. delphi连接sql存储过程

    针对返回结果为参数的 一. 先建立自己的存储过程 ALTER PROCEDURE [dbo].[REName] ) AS BEGIN select ROW_NUMBER() over(order by ...

  8. Delphi连接MySql(待测试验证,使用mysql.pas未通过)

    要在一个Delphi程序中调用Mysql数据库,查到有个资料如下,待验证,验证后会给出结果.暂时做个标记 已经验证,验证日期:2018.6.18 验证结果:不可行 验证工具:XE7,mysql5.5. ...

  9. delphi 连接各中数据库方法

    ---恢复内容开始--- 数据库连接字符串的拼写规则的决定条件: • 连接的数据库的类型:SQL Server,Oracle,MySQL,Acess,MogoDB,Visual FoxPro(dBAS ...

随机推荐

  1. 智行火车票免费加速到VIP最高速抢票(不用朋友积攒或者购买加速包)

    更新: 2018.11.07, 昨天我买火车票,已经不行了,这个bug已经没有了,被修复了, 望大家知悉!!! 智行火车票免费加速到VIP最高速抢票(不用朋友积攒或者购买加速包) 1)下过单后选择抢到 ...

  2. [UE4]虚幻4 spline组件、spline mesh组件的用法

    最近公司项目需要,把这两个东东好好看了下.不得不说,这两个组件还是非常方便的,但是相关的介绍.教程却非常的少.它们概念模糊,用法奇特,我就总结下吧. 首先,先要明白spline component.s ...

  3. [UE4]定义和使用黑板、使用/赋值黑板变量

    黑板,其实就是相当于字典表,一个key对应一个value,key不能重复

  4. Linux中/目录扩容

    1:原来的系统20G,目前增加到30G,我要把增加的10G扩容到/目录下   2:fdisk /dev/sda     (对sda这块磁盘没有被使用的空间进行分区,联想Windows操作系统) 使用L ...

  5. zabbix 3.4新功能值解析——Preprocessing预处理

    Zabbix 3.4版本更新了许多新功能,其中一个监控项功能Preprocessing,根据官方说明文档,在监控项收集的数据存储到数据库前,预先对数据进行处理,使用效果超过预期.这个功能存放位置在创建 ...

  6. SAS ODS GRAPHICS SGPLOT 画图 指存放定路径、名称、指定格式

    OPTION NOCENTER LS=MAX PS=MAX NODATE; LIBNAME S 'E:\00@Data'; PROC FREQ DATA=S.DATA00; TABLES CLE_DA ...

  7. CRM 2016 设置字体颜色

    作者:卞功鑫 ,转载请保留http://www.cnblogs.com/BinBinGo/p/7402809.html setTimeout("window.parent.document. ...

  8. 第11章 拾遗5:IPv6和IPv4共存技术(2)_ISATAP隧道技术

    6.3 ISATAP隧道技术 (1)基本概念 ①在一个IPv4网络中主机与路由器之间创建一条ISATAP隧道,以便让该主机可以访问IPv6网络中的资源. ②条件:IPv4中的PC主机需要支持IPv4和 ...

  9. VS2012常用快捷键!

    Shift+Alt+Enter: 切换全屏编辑Ctrl+B,T / Ctrl+K,K: 切换书签开关Ctrl+B,N / Ctrl+K,N: 移动到下一书签Ctrl+B,P: 移动到上一书签Ctrl+ ...

  10. sublime格式化js、css、html的通用插件-html js css pretty

    sublime格式化js.css.html的通用插件-html js css pretty: 这个插件可以格式化基本上所有js html css文件,包括写在html中的js代码 ,可以在packag ...