读取 Paradox 数据库文件
我正在与一位拥有现有系统的客户合作,该系统显然是建立在 Paradox 数据库之上的。我已经获得了 zip 文件形式的数据库,其中包含 .DB、.MB 和 .PX 文件,每个表一个。
我需要获取(一些)这些数据并将其导入到使用 MySQL 的 Web 应用程序中。有人有办法让我提取这些数据,而不需要安装 Paradox 吗?
如果不是,Paradox 是否以某种可读格式导出?是作为 SQL 还是可以很容易解析的东西?我的客户负责这个系统的人是一名志愿者(他们是非营利组织),所以我想向他提出一个解决方案 - 因为上次我询问数据时,我得到了这个,显然不行。
I'm working with a client who has an existing system, built on what is apparently a Paradox database. I've got the database, in the form of a zip file containing .DB, .MB and .PX files, one for each table.
I need to take (some) of this data and import it in to a Web application that's using MySQL. Does anybody have a way for me to extract this data, that doesn't involve installing Paradox?
If not, does Paradox export in some readable format? Either as SQL or something that can be parsed reasonably easily? The person in charge of this system for my client is a volunteer (they're a non-profit), so I'd like to go to him with a solution - because last time I asked for the data, I got this, which is clearly no good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
关于 Paradox 的维基百科文章列出了另外两件事,可能很有趣,都是根据 GPL 许可证:
如果您有 Delphi 并且想自己编写一个转换器(这需要BDE 工作)你可以看看这篇文章或源代码此网站上的ConvertCodeLib。两者都使用 TClientDataset,它可以写入 CDS(二进制格式)或 XML 文件。
The wikipedia article about Paradox lists two other things, that might be interessant, both under GPL license:
And if you have Delphi and want to write a converter yourself (which would need the BDE to work) you can take a look at this article or at the source code of ConvertCodeLib on this web site. Both make use of TClientDataset, which can write a CDS (binary format) or an XML file.
Paradox for DOS 和 Paradox for Windows 平台都将以定界文本、固定长度文本和 Lotus 1-2-3 格式导出数据表。较旧的 Paradox for DOS 也编写了 Lotus Symphony,而稍微不那么古老的 Paradox for Windows 则编写了一个还过得去的 Excel 5。
但是,必须有人坐下来将表格一张一张地导出,或者编写一个脚本来处理它。当然,您需要安装 Paradox 才能编写脚本。
-阿尔。
Both the Paradox for DOS and Paradox for Windows platforms will export data tables in Delimited Text, Fixed-Length Text, and Lotus 1-2-3 formats. The older Paradox for DOS also writes Lotus Symphony, while the slightly less antique Paradox for Windows does a passable Excel 5.
However, someone will have to sit down and export the tables one by one, or write a script do to it. Of course you'd need to have Paradox installed to write the script.
-Al.
MS 有说明,用于使用 MS Jet 驱动程序从 Paradox 3-5 生成的文件中读取数据。它可以(至少)充当 ODBC 驱动程序,因此您可以使用它从任何知道如何使用 ODBC 的设备读取 Paradox 文件。
MS has instructions for using the MS Jet driver to read data from files produced by Paradox 3-5. That can act as (at least) an ODBC driver, so you can use it to read a Paradox file from just about anything that knows how to use ODBC.
您有几个选择:
You have a few options:
我一直致力于从 Paradox 到 MySQL 的大规模数据迁移。我的一般方法是从 Paradox 导出 CSV 文件,然后从 MySQL 命令行导入 CSV 文件。然而,当 Paradox 中有 M(备忘录)字段时,该系统就会崩溃,因为该数据没有按预期提取到 CSV 文件中。
这是我将 Paradox 数据导入 MySQL 的冗长过程,希望对大家有所帮助!
在Paradox中打开Paradox文件,导出到数据库(.dbf)文件。它的作用是将备忘录数据导出为 dbase 的 blob 格式。
在 Paradox 中打开 .dbf 文件。在 dbfviewer 中打开之前,可能需要将双精度格式转换为长整数或数字。双格式似乎不起作用。保存文件。
使用此程序打开 dbase 文件,然后导出到 Excel:http://dbfviewer.org/
导出-> XLS-File ...这将在 Excel 中打开它
现在我们需要创建一个宏,因为 Excel 没有任何本机方法可以用引号或其他任何内容将 CSV 字段括起来。我已粘贴下面的宏,但这里是我找到的参考站点。有一个网站有更好的说明,但文本已损坏:
http://www.mrexcel.com /forum/showthread.php?320531-export-as-csv-file-enlined-quotes
http://www.markinns.com/articles/full/export_excel_csvs_with_double_quotes/
在 Excel 中,通过 CTRL-F 将所有“替换为 ',替换...记录中的任何”都会弄乱
在 Excel 中按 ALT - F11 打开宏
插入->模块
创建此宏来保存用双引号引起来的 CSV 文件:
子 CSVFile()
Then Run ->运行宏
使用我们想要 blob 所在的文本字段设置目标 MySQL 数据库模式
在 MySQL 命令行中,这里有一个如何进行导入的示例:
加载数据本地内文件'C:/data.csv'
INTO TABLE 表名
以“,”结尾的字段
由“”包围
以 '\r\n' 结尾的行
(column1,column2)
I've been working on a gigantic data migration from Paradox to MySQL. My general approach has been to export CSV files from Paradox, and then import the CSV files from the MySQL command line. However this system breaks down when there are M (memo) fields in Paradox, because that data doesn't get pulled into the CSV file as expected.
Here's my long-winded process for getting Paradox data into MySQL, hopefully it helps somebody!
Open Paradox file in Paradox, export to dbase (.dbf) file. What this does is it exports the memo data into dbase's blob format.
Open the .dbf file in Paradox. It might be necessary to convert double format to long integer or number before opening in dbfviewer. Double format appears to not be working. Save file.
Use this program to open up the dbase file and then export to Excel: http://dbfviewer.org/
Export -> XLS-File … this opens it in Excel
Now we need to create a macro because Excel doesn't have any native way to enclose CSV fields with quotes or anything else. I've pasted the macro below, but here are the reference sites that I found. One site had better instructions but corrupted text:
http://www.mrexcel.com/forum/showthread.php?320531-export-as-csv-file-enclosed-quotes
http://www.markinns.com/articles/full/export_excel_csvs_with_double_quotes/
In Excel replace all " with ' by CTRL-F, replace... any " in records will mess stuff up
In Excel press ALT - F11 to open up macros
Insert -> Module
Create this macro to save CSV files enclosed with double quotes:
Sub CSVFile()
Then Run -> Run Macro
Set up target MySQL db schema with text fields where we want the blobs to go
In MySQL command line here's an example of how to do the import:
LOAD DATA LOCAL INFILE 'C:/data.csv'
INTO TABLE table_name
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(column1, column2)
Paradox 是 Borland 数据库引擎的本机格式,包含在各种 Delphi 编程产品中。所有权最近至少易手一次,但曾经有免费的 Delphi“Express”版本可用,可以让您编写一个简单的程序来导出这些东西。如果免费版本不再可用,则最低可用 SKU 应包含 BDE 功能。
Paradox is a native format for the Borland Database Engine, which is included with various Delphi programming products. Ownership has changed hands at least once recently, but at one point there were free "Express" versions of Delphi available that would let you write a simple program to export this stuff. If a free version is no longer available, the lowest available SKU should include BDE functionality.
使用 MS Access 2007,您可以使用免费的 Paradox 数据库编辑器程序(google 一下)中包含的 BDE 发行版导入 Paradox 7 及更低版本。使用如下连接:
Using MS Access 2007 you can import Paradox 7 and below using the BDE distribution included with the free Paradox Database Editor program (google it). Use a connection such as: