database 如何在 Ubuntu 中打开 .accdb 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1822378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to open an .accdb file in Ubuntu?
提问by pgwillia
The development machine I work on has Ubuntu Jaunty Hymanalope as its operating system. I have been presented with data for a project I'm working on in the form of an .accdb file created by Microsoft Access. I do not own a copy of Microsoft Access. I do have Open Office installed and would be willing to install any software package available to my operating system. Is there a way I can open or transform this file so that I can view and edit the data on my computer? Is there another format that the Access database could be saved as that I would be able to open?
我使用的开发机器使用 Ubuntu Jaunty Hymanalope 作为其操作系统。我以 Microsoft Access 创建的 .accdb 文件的形式提供了我正在处理的项目的数据。我没有 Microsoft Access 的副本。我确实安装了 Open Office,并且愿意安装适用于我的操作系统的任何软件包。有什么方法可以打开或转换此文件,以便我可以在计算机上查看和编辑数据?是否有另一种格式可以保存 Access 数据库,以便我可以打开?
采纳答案by Tony Toews
There are two open source tools available however they only work on MDB format files. Can you ask the supplier of the ACCDB file to give it to you in MDB format?
有两个开源工具可用,但它们只适用于 MDB 格式的文件。请问ACCDB文件的供应商可以给你MDB格式的吗?
MDB Toolsis a set of open source libraries and utilities to facilitate exporting data from MS Access databases (mdb files) without using the Microsoft DLLs.
MDB 工具是一组开源库和实用程序,用于在不使用 Microsoft DLL 的情况下促进从 MS Access 数据库(mdb 文件)导出数据。
Hymancessis a pure Java library for reading from and writing to MS Access databases. It is part of the OpenHMS project from Health Market Science, Inc. . It is not an application. There is no GUI. It's a library, intended for other developers to use to build Java applications. It appears to be much newer than MDB tools, is more active and has write support.
Hymancess是一个纯 Java 库,用于读取和写入 MS Access 数据库。它是 Health Market Science, Inc. OpenHMS 项目的一部分。它不是一个应用程序。没有图形用户界面。它是一个库,旨在供其他开发人员用来构建 Java 应用程序。它似乎比 MDB 工具新得多,更活跃,并且具有写入支持。
回答by Marcel Waldvogel
Hymancessnow supports everything from Access 97 (read-only), 2000, 2003, 2007, and 2010 (read-write), both .mdb and .accdb files.
Hymancess现在支持 Access 97(只读)、2000、2003、2007 和 2010(读写)中的所有内容,包括 .mdb 和 .accdb 文件。
Dumping the file can be as easy as
转储文件可以很简单
import com.healthmarketscience.Hymancess.*;
import java.io.*;
public class AccessExport {
public static void main(String []args) throws IOException {
System.out.println(Database.open(new File(args[0])).getTable(args[1]).display());
}
}
(of course, you need a java compiler, libcommons-logging-java, libcommons-lang-java and you have to pass the .accdb filename as the first and the table name as the second parameter).
(当然,您需要一个 java 编译器、libcommons-logging-java、libcommons-lang-java,并且您必须将 .accdb 文件名作为第一个参数传递,将表名作为第二个参数传递)。
-Marcel
-马塞尔
回答by Richard D
I just had this same problem on an Ubuntu 14.01 AWS EC2 instance and I was able to accomplish this task (convert .accdb
file to CSV on Ubuntu) by using access2csv. I had to install Git, install Java, and install ant, but then was able to convert the .accdb
files I had to CSV
by typing:
我刚刚在 Ubuntu 14.01 AWS EC2 实例上遇到了同样的问题,我能够.accdb
通过使用access2csv完成此任务(在 Ubuntu上将文件转换为 CSV)。我必须安装 Git、安装 Java和安装 ant,但随后能够通过键入以下内容来转换.accdb
我必须转换的文件CSV
:
$ java -jar access2csv.jar myfile.accdb
$ java -jar access2csv.jar myfile.accdb
It uses Hymancessso you get the same functionality without having to write your own Java code to accomplish this basic task. Each table is returned as its own CSV
file.
它使用Hymancess,因此您无需编写自己的 Java 代码即可获得相同的功能来完成此基本任务。每个表都作为其自己的CSV
文件返回。
You can also access the schema by passing the --schema
option:
您还可以通过传递--schema
选项来访问架构:
java -jar access2csv.jar myfile.accdb --schema
java -jar access2csv.jar myfile.accdb --schema
Hope this is helpful. It certainly was for me.
希望这是有帮助的。这当然是给我的。
回答by Eduard Florinescu
A good format to view and work with on Linux would be CSV.
在 Linux 上查看和使用的好格式是 CSV。
As the accepted answer suggests MDB Tools does the job. To export all the tables on Linux to CSV format try this command:
正如公认的答案表明 MDB 工具可以完成这项工作。要将 Linux 上的所有表导出为 CSV 格式,请尝试以下命令:
mdb-tables -d ',' database.accdb| xargs -L1 -d',' -I{} bash -c 'mdb-export database.accdb "" >"".csv' -- {}
You can use mdbtools
also into windows via WSL (Ubuntu on Windows or Debian on Windows):
Then install it in console with:
您还可以mdbtools
通过 WSL(Windows 上的 Ubuntu 或 Windows 上的 Debian)在 Windows 中使用:然后在控制台中安装它:
sudo apt install mdbtools
回答by Fionnuala
This may be of interest: How to convert accdb to a postgres database
这可能很有趣:How to convert accdb to a postgres database
I am not sure if Wine
would suit, but it might be worth a look.
我不确定是否Wine
适合,但它可能值得一看。
回答by Philippe Grondier
I guess you want to extract data from tables, not code from modules. I do not know specifically Ubuntu but I guess you can connect to the access file using an ODBC connection (or, if available, OLEDB connection) and extract the data? Depending on the connection type, you might still need to know the tables names in order to import them.
我猜您想从表中提取数据,而不是从模块中提取代码。我不知道具体是 Ubuntu,但我想您可以使用 ODBC 连接(或者,如果可用,OLEDB 连接)连接到访问文件并提取数据?根据连接类型,您可能仍需要知道表名称才能导入它们。
回答by Makada
Microsoft Access Runtime is a free software. You can install it in Ubntu using Wine and then open the accdb database.
Microsoft Access Runtime 是一款免费软件。您可以使用 Wine 将其安装在 Ubntu 中,然后打开 accdb 数据库。
回答by Henri
Im not sure if there are any native tools, but you can always install a copy of windows and install a free view for accdb files or install a trial of Access.
我不确定是否有任何本机工具,但您始终可以安装 Windows 副本并安装 accdb 文件的免费视图或安装 Access 试用版。