consolidator
/
mdbDebug.py
23 строки · 683.0 Байт
1import traceback
2import sys
3from MdbHelper import MdbHelper
4import pyodbc
5
6path = "D:\\work\\Укрупнение\\current\\pyExcelCons3\\msa\\КПК_все.mdb"
7
8if __name__=="__main__":
9try:
10drivers = [i for i in pyodbc.drivers() if i.startswith('Microsoft Access Driver')]
11print(drivers)
12print("is 64 bit:",sys.maxsize > 2**32)
13
14mdb = MdbHelper(path)
15print(mdb.connection_str)
16mdb.connect()
17info = mdb.db_info()
18print(f"info: {info}")
19df = mdb.get_table_df("Справочник МТР1")
20print(df)
21mdb.close_connection()
22except Exception as exp:
23print(traceback.format_exc())