DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: hcwong1993
今日帖子: 39
在线用户: 8
导航: 论坛 -> 数据库专区 斑竹:liumazi,waterstone  
作者:
男 hbdjlwb1 (hbdjlwb1) ▲▲△△△ -
普通会员
2023/8/3 22:28:50
标题:
超过255个字段的dbf,如何插入数据 浏览:754
加入我的收藏
楼主: 2个adoquery,1个连接mssql(adoquer2),一个连接dbf文件(adoquery1)。当DBF字段小于255个时,可open打开adoquery1,循环把adoquery2的记录赋给adoquery1。
问题:当DBF文件大于255个时,无法open,请教一下,这种情况如何把mssql的数据导出到dbf?
谢谢大家。
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/8/4 0:07:13
1楼: DBF database file LIMITS:

https://www.dbase.com/Knowledgebase/faq/dBASE_Limits_FAQ.html


Records in a table = 1 Billion
Bytes in .DBF (Table) file  = 2 Billion
Size in bytes per record (dBASE 4) = 4000
Size in bytes per record (dBASE for Windows) = 32767
Number of fields per table (dBASE 4) = 255
Number of fields per table (dBASE for Windows) = 1024
Number of index tags per .MDX file = 47
Size of character fields = 254
Open master indexes (.MDX) per table = 10
Key expression length in characters = 220


more about DBF files:
https://en.wikipedia.org/wiki/.dbf

tip: read about usage of "Sybase Advantage Database" with DBF files
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/8/4 15:01:00
2楼: 你的字段数大于255的DBF文件是用什么软件创建出来的?
----------------------------------------------
-
作者:
男 hbdjlwb1 (hbdjlwb1) ▲▲△△△ -
普通会员
2023/8/4 16:38:06
3楼: 用的DBF Manager
----------------------------------------------
-
作者:
男 roadrunner (roadrunner) ★☆☆☆☆ -
盒子活跃会员
2023/8/4 18:08:08
4楼: 既然是自己生成的DBF, 那就不是老项目了

新项目你不选SQLITE你是怎么想的?
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2023/8/4 21:19:59
5楼: try convert your DBF file D.O.S. to DBF for Windows and updates your access drivers for it.

Number of fields per table (dBASE for Windows) = 1024
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/8/4 21:58:19
5楼: 估计你用的dbf格式是Clipper/dBaseIII,如果是这样的话可以用Apollo 7.3来做读写
ftp://uploads.2ccc.com里面有这个东西,登录密码是uploads,密码为空。
使用里面的TApollTable组件,属性TableType := ttSXNTX
----------------------------------------------
-
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/8/5 8:20:31
6楼: 如果你只是想使用dbf文件在两台SQL Server服务器之间做数据的导入和导出,那么你应该改用SQL Server自带的bcp.exe工具来生成bcp文件,实现两台服务器之间数据的导入和导出。用bcp.exe来导出/导入SQL Server数据是最快的,没有之一。
----------------------------------------------
-
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/8/5 8:23:46
7楼: 如果两台服务器能连通, 可直接在两台服务器之间做数据的导入和导出, 不需要通过中间数据。
----------------------------------------------
-
作者:
男 hbdjlwb1 (hbdjlwb1) ▲▲△△△ -
普通会员
2023/8/10 8:46:13
8楼: procedure TForm1.Button1Click(Sender: TObject);
var
  i, j: Integer;
begin
  with ADOQuery1 do
  begin
    Close;
    SQL.Clear;
    SQL.Add(' select *from infoxx');
    Open;
  end;


  //开始从adoquery2中插入数据 到adoquery1(超过255个字段)中
  ADOQuery2.First;
  try
    while not ADOQuery2.Eof do
    begin
      ADOQuery1.Append;
      for i := 0 to ADOQuery2.FieldCount-1 do
      begin
        ADOQuery1.Fields[i].Value := ADOQuery2.Fields[i].Value;
      end;
      ADOQuery2.Next;
    end;
    ADOQuery1.UpdateBatch();
    ShowMessage('已完成'+IntToStr(ADOQuery1.RecordCount));
   finally

   end;

  end;
插入时,超过255个字段就会报错,无法插入。错误提示:adoquery1:list index out of bounds(255)
----------------------------------------------
-
作者:
男 bluestorm8 (bluestorm) ▲▲△△△ -
普通会员
2023/8/10 10:21:29
9楼: 为什么你坚持要用ado?
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行70.3125毫秒 RSS