This should work:
#!/usr/bin/env##Database=group
##Access.mdb pythonto SqLite=name
##inputmdb= input file
##outputsqlite = output file
import sys, subprocess, os, sqlite3 as sql
mdb_name = sys.argv[1]inputmdb
sql_name = sys.argv[2]outputsqlite
try:
print "\nopening db"
conn = sql.connect(sql_name)
curs = conn.cursor()
print "\ncreating schema"
cmds = subprocess.Popen(["mdb-schema", mdb_name, "mysql"], stdout=subprocess.PIPE).communicate()[0]
curs.executescript(cmds)
conn.commit()
print "\nfetching table names"
table_names = subprocess.Popen(["mdb-tables", "-1", mdb_name], stdout=subprocess.PIPE).communicate()[0]
tables = table_names.splitlines()
print "\npopulate tables"
for table in tables:
if table != '':
cmds = subprocess.Popen(["mdb-export", "-I", "mysql", mdb_name, table], stdout=subprocess.PIPE).communicate()[0]
curs.executescript("BEGIN;" + cmds + "COMMIT;")
conn.commit()
print "\nhoooray"
except Exception, e:
print "oh noes:"
print e
finally:
print "\nclosing DB"
conn.close()
python mdb2sqlite.py testdb.mdb dump.db