how to deal with .mdb access files with python

后端 未结 6 1146
逝去的感伤
逝去的感伤 2020-12-08 00:45

Can someone point me in the right direction on how to open a .mdb file in python? I normally like including some code to start off a discussion, but I don\'t know where to s

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 00:46

    There's the meza library by Reuben Cummings which can read Microsoft Access databases through mdbtools.

    Installation

    # The mdbtools package for Python deals with MongoDB, not MS Access. 
    # So install the package through `apt` if you're on Debian/Ubuntu
    $ sudo apt install mdbtools
    $ pip install meza
    

    Usage

    >>> from meza import io
    
    >>> records = io.read('database.mdb') # only file path, no file objects
    >>> print(next(records))
    
    Table1
    Table2
    …
    

提交回复
热议问题