Connect old access datbase .mdb - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Networking (https://python-forum.io/forum-12.html) +--- Thread: Connect old access datbase .mdb (/thread-31450.html) Pages:
1
2
|
Connect old access datbase .mdb - nio74maz - Dec-12-2020 Hi, I need help, I'm trying to connect to an access database .mdb maybe from 2002,I am trying with pyodbc bat it tells me that the program is done whit older version. code: import pyodbc conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Users\nio74\Desktop\dati.mdb;PWD=gmpa;') cursor = conn.cursor()Error: pyodbc.Error: ('HY000', "[HY000] [Microsoft] [ODBC Microsoft Access Driver] Cannot open a database created with a previous version of the application. (-1019) Some idea? I have search driver OLEDB because i had made an application in PHP I was working with that driver, but I can't find for python RE: Connect old access datbase .mdb - Larz60+ - Dec-12-2020 You should probably use a database conversion program before writing your python code. I found something that looks capable of doing that here: https://support.microsoft.com/en-us/office/convert-a-database-to-the-accdb-file-format-098ddd31-5f84-4e89-8f44-db0cf7c11acd RE: Connect old access datbase .mdb - nio74maz - Dec-12-2020 (Dec-12-2020, 04:42 PM)Larz60+ Wrote: You should probably use a database conversion program before writing your python code. unfortunately the database works on a management software and I cannot convert it otherwise the management software no longer works RE: Connect old access datbase .mdb - Larz60+ - Dec-13-2020 can you make a copy? RE: Connect old access datbase .mdb - nio74maz - Dec-13-2020 i could find an old version of office and save it in a newer copy, but can i sync it with the old one later? RE: Connect old access datbase .mdb - Larz60+ - Dec-13-2020 Access was never a good DBMS it's been a mighty long time since i used it. If you can rewrite the original code to use something better, sqlite would be good replacement for Access, but If a rewrite was in order, I'd choose PostgreSQL. If you have to live with the legacy code, you might want to look at https://www.microsoft.com/en-us/download/details.aspx?id=13255 and implement into python. This looks like just that: https://pypi.org/project/msaccessdb/ The same author that wrote above, also wrote an SQLAlchemy interface to MSAccess: https://pypi.org/project/sqlalchemy-access/ RE: Connect old access datbase .mdb - nio74maz - Dec-13-2020 I'm trying in every way even with the run time 2003 I can only open it with MDBplus opens. I post the database maybe I am incapable. this is the database: database RE: Connect old access datbase .mdb - nio74maz - Dec-13-2020 I'm trying in every way even with the run time 2003 I can only open it with MDBplus opens. I post the database maybe I am incapable. this is the database: https://github.com/nio74/damndatabase password gmpa RE: Connect old access datbase .mdb - nio74maz - Dec-15-2020 I offer a case of beer to whoever succeeds RE: Connect old access datbase .mdb - Larz60+ - Dec-15-2020 I don't know if this tool is available for windows, but seems to work on linux you will need to install mdbtools:
This is a command line tool, so next open a command window the following commands are available: with this tool, you can get a list of all tables, and dump them to CSV, SQL, or json I got a list of all tables usingmdb-tables dati.mdb > tablelist.txt listed here: the data can be exported to csv, sql or jsonIt looks like you can get an MS windows version here: https://sourceforge.net/projects/mdbtools/ |