生成DBF文件

发布于 2024-08-13 08:00:15 字数 176 浏览 2 评论 0原文

如何用delphi生成DBF文件?

更多信息:

我需要一个便携式数据库在随身碟中运行,

我不知道 DBF 是否是更好的解决方案。

我喜欢 MySql,但很难找到可移植版本。

我现在正在使用 XML,但我不知道如何进行查询。

How to generate DBF files with delphi?

More information:

I need a portable Database to run in a pendrive

I don't know if DBF is the better soluttion.

I like MySql but is hard to find a portable version

I am working with XML at this time but I don't know how to make a Query.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

埋情葬爱 2024-08-20 08:00:15

TDBF 似乎是最常用(且仍在维护)的软件包之一:

http://tdbf.sourceforge.net/< /a>

TDBF seems to be one of the most used (and still maintained) packages:

http://tdbf.sourceforge.net/

一梦等七年七年为一梦 2024-08-20 08:00:15

如果您愿意接受其他格式,我强烈建议您查看嵌入式 Firebird。我很确定我在大约两年前将数据库和应用程序加载到闪存驱动器上作为实验,并且运行良好。我很长一段时间都坚持使用 DBF 文件,但一旦我做出了转变,我就再也不会回头了。如果您想尝试一下,请考虑使用 DBExpress 和 Interbase 驱动程序。虽然它没有得到官方支持,但我没有发现任何不兼容的情况。对于可视化管理工具,请获取 IBExpert 个人版。

If you are open to alternative formats, I would strongly recommend you check out Firebird embedded. I'm pretty sure I loaded my database and my application on a flash drive as an experiment about two years ago and it ran fine. I stuck with DBF files for a long time, but once I made the switch, I would never go back. If you want to give this a try, consider using DBExpress and the Interbase driver. Although it's not officially supported, I have not found any incompatibilities. For a visual management tool, get the personal edition of IBExpert.

-残月青衣踏尘吟 2024-08-20 08:00:15

已经很多年没有处理过这个问题了!
根据您的 Delphi 版本以及您想要执行的操作,您可以使用 BDE 或查找一些直接读/写 DBF 本机文件格式的专用组件。

Not dealt with that in years!
Depending on your version of Delphi and what you want to do, you can either use the BDE or find some specialized components that read/write directly to DBF native file format.

小鸟爱天空丶 2024-08-20 08:00:15

哇,我很惊讶这个网址仍然有效!

如果您想使用 BDE API 创建 DBF,可以使用此处的技术:
http://info.borland.com/devsupport/bde/bdeapiex/dbicreatetable。 html

但是,根据您将拥有的数据集的大小,这听起来像是一个单用户应用程序,它可以与“MyBase”文件(使用的文件的另一个名称)一起正常工作。 TClientDataSet。您只需设置 TClientDataSet.FileName 属性即可将其保存为 XML 或二进制 (CDS) 格式,该属性将用于读取和写入数据集。您甚至可以用它创建嵌套数据集。

如果您想拥有最高效的单用户模式,还可以关闭 TClientDataSet 上的 ChangeLog。

procedure TFormCDSDataBug.ButtonOpenClick(Sender: TObject);
begin
  ClientDataSet1.FileName := ExtractFilePath(Application.ExeName) + 'MyData.cds';
  ClientDataSet1.LogChanges := False;
  ClientDataSet1.Open;
end;

Wow, I'm amazed this url is still valid!

If you want to create a DBF with the BDE API, you can use the techniques here:
http://info.borland.com/devsupport/bde/bdeapiex/dbicreatetable.html

However, depending on the size of the dataset you're going to have, this sounds like a single-user app, which would work just fine with a "MyBase" file -- another name for the files used by TClientDataSet. You can save it either as XML or binary (CDS) format by simply setting the TClientDataSet.FileName property, which will be used to read and write the dataset. You can even create nested datasets with this.

If you want to have the most efficient single user mode, also turn off the ChangeLog on the TClientDataSet.

procedure TFormCDSDataBug.ButtonOpenClick(Sender: TObject);
begin
  ClientDataSet1.FileName := ExtractFilePath(Application.ExeName) + 'MyData.cds';
  ClientDataSet1.LogChanges := False;
  ClientDataSet1.Open;
end;
≈。彩虹 2024-08-20 08:00:15

虽然我还没有使用过它,但有一个组件 jdDbf 似乎最近更新,看来它会起作用。需要注意的是,Dbf 格式有多种风格,但是大多数差异似乎都在索引文件中,因此如果您需要将其与其他系统一起使用,则可能需要重建它们。

对于在 USB 驱动器上运行良好的嵌入式数据库,我会考虑 SQLite。有一个 Delphi 实现 DISQLite3,它有一个免费且专业的版本运行良好并强烈推荐的版本。目前有许多商业质量程序在使用它,包括 FeedDemon

While I haven't used it, there is a component jdDbf which appears to be recently updated that appears that it will work. Something to be aware of is that the Dbf format has many flavors, however most of the variances appear to be in the index files so if you need to use it with another system you might have to rebuild them.

For a embedded database that works well on a usb drive, I would look at SQLite. There is a Delphi implementation DISQLite3 which has a free and pro version that would work well and comes highly recommended. There are many commercial quality programs currently using it, including the likes of FeedDemon.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文