读取 Paradox 数据库文件

发布于 2024-08-08 07:36:53 字数 302 浏览 4 评论 0原文

我正在与一位拥有现有系统的客户合作,该系统显然是建立在 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 技术交流群。

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

发布评论

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

评论(7

书信已泛黄 2024-08-15 07:36:53

关于 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.

等你爱我 2024-08-15 07:36:53

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.

迷离° 2024-08-15 07:36:53

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.

长亭外,古道边 2024-08-15 07:36:53

您有几个选择:

  1. 掌握原始 Paradox 软件,并使用它将数据库导出到 CSV 格式。不幸的是,Borland 不再销售它,而且最新版本在 Windows XP 或更高版本上运行不佳。
  2. 使用 Paradox 或 dBase/xBase ODBC 驱动程序访问数据库。 Paradox 和 xBase 非常相似,因此您可以使用适用于它们的驱动程序来提取数据。您可以在 firebirdsql.org 上的某个位置获取 Paradox ODBC 驱动程序。
  3. 使用 Borland Delphi 编写一个程序来导出您需要的数据。正如其他人提到的,您可以获得一个名为 Turbo Explorer 的免费版本。您还必须单独安装 BDE,因为它不随 Turbo Explorer 一起提供。

You have a few options:

  1. Get your hands on the original Paradox software, and use it to export the database into CSV format. Unfortunately, Borland no longer sells it and the most recent version doesn't run well on Windows XP or above.
  2. Access the database using either a Paradox or dBase/xBase ODBC driver. Paradox and xBase are very similar, so you may be able to extract the data using drivers meant for either of them. You may be able to get a Paradox ODBC driver somewhere on firebirdsql.org.
  3. Use Borland Delphi to write a program which will export the data you need. As someone else mentioned, you can get a free version called Turbo Explorer. You will also have to install the BDE seperately, as it doesn't come with Turbo Explorer.
错々过的事 2024-08-15 07:36:53

我一直致力于从 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()

    将 SrcRg 调暗为范围
    暗淡当前行作为范围
    暗淡 CurrCell 作为范围
    Dim CurrTextStr 作为字符串
    将 ListSep 变暗为字符串
    暗淡的 FName 作为变体
    FName = Application.GetSaveAsFilename("", "CSV 文件 (*.csv), *.csv")
    
    如果 FName <>那么错误
    ListSep = Application.International(xlListSeparator)
    如果 Selection.Cells.Count > 1 然后
    设置 SrcRg = 选择
    别的
    设置 SrcRg = ActiveSheet.UsedRange
    结束如果
    打开 FName 输出为 #1
    对于 SrcRg.Rows 中的每个 CurrRow
    当前文本Str =“”
    对于 CurrRow.Cells 中的每个 CurrCell
    CurrTextStr = CurrTextStr & “”“”& CurrCell.Value 和 CurrCell.Value “”“”&列表九月
    下一个
    而 Right(CurrTextStr, 1) = ListSep
    CurrTextStr = 左(CurrTextStr, Len(CurrTextStr) - 1)
    文德
    打印#1,CurrTextStr
    下一个
    关闭 #1
    结束如果
    结束子
    
  • 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()

    Dim SrcRg As Range
    Dim CurrRow As Range
    Dim CurrCell As Range
    Dim CurrTextStr As String
    Dim ListSep As String
    Dim FName As Variant
    FName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv")
    
    If FName <> False Then
    ListSep = Application.International(xlListSeparator)
    If Selection.Cells.Count > 1 Then
    Set SrcRg = Selection
    Else
    Set SrcRg = ActiveSheet.UsedRange
    End If
    Open FName For Output As #1
    For Each CurrRow In SrcRg.Rows
    CurrTextStr = ""
    For Each CurrCell In CurrRow.Cells
    CurrTextStr = CurrTextStr & """" & CurrCell.Value & """" & ListSep
    Next
    While Right(CurrTextStr, 1) = ListSep
    CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1)
    Wend
    Print #1, CurrTextStr
    Next
    Close #1
    End If
    End Sub
    
  • 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)

债姬 2024-08-15 07:36:53

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.

墨小沫ゞ 2024-08-15 07:36:53

使用 MS Access 2007,您可以使用免费的 Paradox 数据库编辑器程序(google 一下)中包含的 BDE 发行版导入 Paradox 7 及更低版本。使用如下连接:

DoCmd.TransferDatabase acImport, "ODBC Database", _
    "Paradox 3.X;HDR=NO;IMEX=2;ACCDB=YES;DATABASE=C:\apache\Archive;TABLE=Messages#db", _
    acReport, DailyArchiveName, "MyDatabase"

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:

DoCmd.TransferDatabase acImport, "ODBC Database", _
    "Paradox 3.X;HDR=NO;IMEX=2;ACCDB=YES;DATABASE=C:\apache\Archive;TABLE=Messages#db", _
    acReport, DailyArchiveName, "MyDatabase"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文