Install microsoft access in linux

How to use an ms-access file from linux?

Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. Although it is primarily designed for use on Windows, it can also be used on other platforms such as Linux, with some limitations. If you want to use an MS-Access file on a Linux system, there are a few options available to you.

Method 1: Wine

To use an MS-Access file from Linux, we can use Wine. Wine is a compatibility layer capable of running Windows applications on Linux. Here are the steps to use an MS-Access file from Linux with Wine:

Step 1: Install Wine

First, we need to install Wine on our Linux system. Here is the command to install Wine on Ubuntu:

Step 2: Install MS-Access

Next, we need to install MS-Access on Wine. We can install it by following these steps:

  1. Download the MS-Access installer from Microsoft website.
  2. Open the terminal and navigate to the directory where the installer is downloaded.
  3. Run the following command to start the installation:

Step 3: Open MS-Access file

Once MS-Access is installed, we can open the MS-Access file by following these steps:

  1. Open the terminal and navigate to the directory where the MS-Access file is located.
  2. Run the following command to open the MS-Access file:
wine msaccess.exe /path/to/access/file.accdb

This will open the MS-Access file in Wine, and we can use it just like we would on a Windows system.

Method 2: Virtual Machine

  1. Install VirtualBox on your Linux machine.
  2. Download the Windows ISO file and create a new virtual machine on VirtualBox with Windows as the guest OS.
  3. Install Microsoft Access on the Windows virtual machine.
  4. Share the MS-Access file from the Windows virtual machine to the Linux host machine by adding a shared folder in VirtualBox.
  5. Mount the shared folder on the Linux machine by running the following command:
sudo mount -t vboxsf shared_folder_name /mnt/mount_point
  1. Access the MS-Access file from the mounted folder using ODBC connection. Install ODBC drivers for MS-Access on the Linux machine and configure the connection string in your code.
import pyodbc conn_str = ( r'DRIVER=;' r'DBQ=/mnt/mount_point/path/to/access_file.accdb;' ) conn = pyodbc.connect(conn_str) cursor = conn.cursor() cursor.execute('SELECT * FROM table_name') rows = cursor.fetchall() for row in rows: print(row)

That’s it! You can now use the MS-Access file from your Linux machine using VirtualBox.

Читайте также:  Смена обоев в линуксе

Method 3: Remote Desktop Connection

sudo apt-get update sudo apt-get install xrdp
rdesktop windows_machine_ip>
cd "C:\Program Files\Microsoft Office\OfficeXX" msaccess.exe "C:\path\to\your\file.accdb"
  1. You can now use your MS-Access file from your Linux machine through the Remote Desktop Connection.

Note: Make sure that your Windows machine has Remote Desktop enabled and that your Linux machine can connect to it. Also, make sure that you have the necessary permissions to access the MS-Access file.

Method 4: Converting to Other Database Format

sudo apt-get install mdbtools
mdb-schema file.mdb | sqlite3 file.sqlite for i in $(mdb-tables file.mdb); do mdb-export -I sqlite file.mdb $i > $i.sql; done for i in $(ls *.sql); do sqlite3 file.sqlite  $i; done
mdb-schema file.mdb mysql | mysql -u username -p -h localhost dbname for i in $(mdb-tables file.mdb); do mdb-export -I mysql file.mdb $i | mysql -u username -p -h localhost dbname; done
mdb-schema file.mdb postgres | psql -h localhost -U username dbname for i in $(mdb-tables file.mdb); do mdb-export -I postgresql file.mdb $i | psql -h localhost -U username dbname; done

Note: Replace «file.mdb» with the name of your MS-Access file, and replace «username», «dbname», and «localhost» with your own MySQL/PostgreSQL settings.

This method allows you to use an MS-Access file from Linux by converting it to another database format. You can then access the converted data using the appropriate database tools and libraries.

Источник

Thread: Microsoft Access in Wine

gunksta is offlineGrande Half-n-Half Cinnamon Ubuntu

Microsoft Access in Wine

This is my little Microsoft Access in Wine thread. The goal: Make it easier for Linux users to install and use Microsoft Access under Wine. Wine reviews will tell you it is not possible to use Access under Wine; they are wrong. With a few tricks, most things work with only a handful of exceptions (documented below). I have continued to update this guide as I learn more. If you have any problems or breakthroughs, I’d appreciate the info.

History: I originally started a thread that can be found here, to learn more about using Access under Wine. I did not find the solution I was looking for, but I did receive a couple of interesting links that got me to thinking. I also read this and this to get more of an understanding regarding how MS Access works on Windows. When I found winetricks, things started to fall together for me.

These instructions have been tested on Jaunty x86 (I’m going to test it on my 64-bit machine soon). Because these instructions rely on winetricks, these instructions may or may not work on older versions of Ubuntu.

Start with a fresh .wine directory. You can get this by moving or deleting .wine/.
Run winecfg to set up a new .wine folder.

  1. Download winetricks from the link.
  2. Start winetricks with:
  • allfonts (This is really optional, but worth doing.)
  • fakeie6 (Not necessary, but I hoped this would fix the help bug.)
  • jet40 (this is absolutely necessary)
  • mdac28
  • msxml3
  • msxml6
  • richedit20
  • richedit30
  • vb6run
  • vcrun

    Mount the CD with the unhide option. Ubuntu automatically mounts the CD, so first you will need to unmount the CD (do NOT eject) and then re-mount it with

mount -t iso9660 -o unhide /dev/cdrom /media/cdrom0

The process I describe above worked for me (mostly). If it does not work for you, post your problems here! I do not guarantee anything and this may very well break with the next update (Karmic Koala) but it works for me today.

What Works / What Don’t: There are some problems with Access. I suppose I would give it a Silver or Bronze star on WineHQ. (They prefer that users post reviews based on «pure» wine installations, which this is not so I won’t sully their system with my review.) I appear to have basic functionality. The following functionality appears to work correctly:

  • Create Tables
  • Create / Run Queries
  • Create / Run Macros
  • Basic Forms appear to work

However, there are some problems:

  • Do NOT use any of the Wizards! They will freeze Access.
  • The Help function tries to work, but displays empty windows.
  • Office puts an icon into Ubuntu’s Notification Area. Like other Wine apps, this tends to not look right and can cause some minor problems with other things in the notification area.
  • «Create Query in Design View» has a minor problem. Normally when you start a query in design view, you are able to select the tables / queries you want to use as input to your query. In Wine, this dialog is ALWAYS empty, regardless of how many tables and queries are in the database. Workaround: Switch to SQL mode and complete the FROM your_table_here statement. If you then switch back to design mode, the table appears correctly.
  • Decimal numbers look funny in table view and query view. For example, a number (double) that should be 360.234345 will be displayed as 3..60234345. In spite of the weird look. However, Access is using/calculating the number correctly. The problem appears to be related to the the display of the numbers. I can successfully export my query results to an excel spreadsheet, and the spreadsheet contains accurate decimal numbers that display correctly in Excel and OOo Calc. Depending on what you are doing, this bug may or may not be a big problem.
  • Find is not usable. The text boxes for inputting the string you are looking for can not be selected. You can not use «find» to help you find the correct form.

I haven’t tested everything and I honestly probably won’t test everything. If you try something that I haven’t had time to play with, please let me know.

  • I have not tried to write any VBA script. I don’t know if it works or not, but we have installed the VB stuff, so it may function correctly. As I mentioned earlier, macros do work, which may provide much of the functionality you need, but you may have to get a little creative.
  • I have not developed any reports (yet). I will.
  • I have not tried to use the Access web front-end. I will be surprised if this works.

I hope someone finds this useful. Feel free to submit ideas, suggestions, etc. Report any problems you may have.

I will update this initial post form time to time as I learn more about Access and how to use it effectively in Wine.

Источник

HowTo: Open a Microsoft Access .accdb file in Ubuntu

Recently, I need to run a .accdb file in Ubuntu. I use ubuntu 14.04 LTS version. I tried to run with LibreOffice Base. But failed. And thanks to AskUbuntu. I got the solution from there.

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 14.04 LTS.

First, I installed LibreOffice Base itself

sudo apt-get install libreoffice-base

Then I downloaded UCanAccess to my Downloads folder and unzipped it.

I launched LibreOffice (not Base, just LibreOffice itself)

LibreOffice.png

ToolsOptions.png

On the Advanced tab I clicked the “Class Path…” button

ClassPath.png

and then added the following five (5) JAR files using the “Add Archive…” button:

/home/abrar/Downloads/UCanAccess-2.0.9.5-bin/ucanaccess-2.0.9.5.jar /home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/commons-lang-2.6.jar /home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/commons-logging-1.1.1.jar /home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/hsqldb.jar /home/abrar/Downloads/UCanAccess-2.0.9.5-bin/lib/jackcess-2.1.0.jar

AddArchive.png

Note that you must close and re-open LibreOffice for the new Class Path values to take effect.

Then I launched LibreOffice Base, and in Step 1 of the wizard I chose “Connect to an existing database (JDBC)”

ExistingDatabase.png

The Access file I wanted to manipulate was named “baseTest.accdb” in my Downloads folder, so in Step 2 the “Datasource URL” was

jdbc:ucanaccess:///home/abrar/Downloads/baseTest.accdb

and the “JDBC driver class” was

net.ucanaccess.jdbc.UcanaccessDriver

JdbcConnection.png

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 in the .accdb file

Tables.png

This solution is collected from here. Thanks Gord Thompson, you helped me a lot.

Share this:

Источник

Оцените статью
Adblock
detector