Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jcmc

macrumors regular
Original poster
Nov 16, 2008
141
59
Hi there,

So I have quite happily run VMWare Fusion 7 on my late 2010 iMac for a number of years, primarily so I could access a largish Microsoft Access database I use regularly for reference. Recently I updated my iMac to High Sierra which broke my VMWare compatibility and, because I essentially use it for nothing else, I thought I might try and export my Access database to a spreadsheet and find a suitable Mac database application.

So I downloaded VMWare Fusion 10 with a view of using the 30-day trial to do this and I'm getting all sorts of error messages which people on the VMW forums suggest a workaround which looks hugely complex (for me) and not necessarily especially secure.

So to the question: I have the database .mdb file but I cannot open it as I can't access my virtual machine. Is there anything I can do with it to convert or export it outside my inaccessible Access application?

Thanks,

C.
 

jcmc

macrumors regular
Original poster
Nov 16, 2008
141
59
Didn't review well at all on Mac App Store. Tried mdb lite instead and immediately got a vague error message upon trying to access database. Have sent a report to developers but not at all encouraged.
 

organicCPU

macrumors 6502a
Aug 8, 2016
828
287
In case you don't want to wait for a solution for mdb lite, here is how it should work:

http://brewformulas.org/Mdbtools
Code:
brew install mdbtools

https://stackoverflow.com/questions...an-mdb-access-file-to-mysql-or-plain-sql-file

Extracted from the answers at stackoverflow a shell script based on mdbtools that was created by mikkom and is hosted by togume does the actual conversion:
https://gist.github.com/togume/83b4bf40e1528742374bbce338270f34

Code:
#!/bin/bash
TABLES=$(mdb-tables -1 $1)

for t in $TABLES
do
  echo "DROP TABLE IF EXISTS $t;"
done

mdb-schema $1 mysql
for t in $TABLES
do
  mdb-export -D '%Y-%m-%d %H:%M:%S' -I mysql $1 $t
done

If you paste the above code into a text editor and save it as to_mysql.sh, you could use it like this
Code:
./to_mysql.sh database.mdb > data.sql
or
./to_mysql.sh database.mdb | mysql destination-db -u user -p

Hope this helps.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.