We can use the UCanAccess JDBC driver to connect to Access databases (.mdb and .accdb) in LibreOffice Base. Here's how I did it on a clean install of Ubuntu 20.04 LTS.
First, I installed LibreOffice Base
sudo apt-get install libreoffice-base
Then I downloaded UCanAccess (bin.zip
file) and unzipped it into the folder
~/Downloads/JDBC/UCanAccess
Note: When unzipping the distribution file be sure to specify "Keep directory structure" (or similar, depending on your unzip tool) so the folder structure appears as in the screenshot above.
I launched LibreOffice (not Base, just LibreOffice itself)
and chose Tools > Options
On the Advanced tab I clicked the "Class Path..." button
and then added the following JAR file using the "Add Archive..." button:
/home/gord/Downloads/JDBC/UCanAccess/loader/ucanload.jar
Note that this is ucanload.jar in the loader/ subfolder, not "ucanaccess-x.y.z.jar” in the UCanAccess home folder.
Important: You must close and re-open all LibreOffice (or OpenOffice.org) components for the new "Class Path...” value to take effect. That includes any "quick start” features or other related processes. (If you want to play it safe, simply restart your machine.)
I launched LibreOffice Base, and in Step 1 of the wizard I chose "Connect to an existing database (JDBC)"
The Access file I wanted to manipulate was named "uca301demo.accdb" in my Documents folder, so in Step 2 the "Datasource URL" was …
ucanaccess:///home/gord/Documents/uca301demo.accdb
(note that Base supplies the jdbc: prefix for us, so all we need to enter is the remainder of the URL starting with ucanaccess: …)
… and the "JDBC driver class" was
net.ucanaccess.jdbc.UcanloadDriver
In Step 3, I left the "User name" field empty and just clicked "Next >>".
In Step 4, I saved the LibreOffice Base database as "accdbTest.odb" in my Documents folder.
When the wizard completed it opened my LibreOffice database and I could see the tables and saved queries in the .accdb file
If you are using a distribution that installs LibreOffice Base by default (e.g., Linux Mint) then you may receive the error
The connection to the data source "MyDatabase" could not be established.
'org.hsqldb.persist.HsqlProperties org.hsqldb.DatabaseURL.parseURL(java.lang.String, boolean, boolean)'
That is because LibreOffice has installed its own (rather old) copy of HSQLDB that conflicts with UCanAccess. To fix that, remove LibreOffice's copy of HSQLDB. For example, on Linux Mint that would be
sudo apt remove libhsqldb1.8.0-java
Also, if LibreOffice Base won't work for whatever reason you can use DBeaver instead. Installing the (free) Community Edition is as easy as
sudo snap install dbeaver-ce
Is it possible to open an Access 2010 database file without using Wine or VirtualBox?