python and databases

Michael Torrie torriem at gmail.com
Tue Mar 14 20:23:21 EDT 2017


On 03/14/2017 01:59 PM, Xristos Xristoou wrote:
> I have a database in  microsoft ACCESS with about 150 records.. if I
> want to get some data from this database using  a query in python and
> i want to store in some variables in python that will do this ? to
> avoid the 150 if ...: Using the standard library the python? know
> easily put it an SQL query but i canot use additional library
> python.

If you simply want to move data to an sql server, your best bet is to
use mdbtools to dump the database schema and records out to an .sql file
that you can then massage and import into whatever sql server you are
using.

https://github.com/brianb/mdbtools

If you're looking for a way to use the access file directly, and
continue using it in MS Access, you might be able to get the odbc bridge
working (on windows of course), and communicate with it with pyodbc.


More information about the Python-list mailing list