31 lines
627 B
Python
31 lines
627 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import pypyodbc
|
|
|
|
|
|
pypyodbc.lowercase = False
|
|
conn = pypyodbc.connect(
|
|
r"Driver={Microsoft Access Driver (*.mdb, *.accdb)};" +
|
|
r"Dbq=C:\Users\Lorenz\Desktop\wgmaster2010.accdb;")
|
|
cur = conn.cursor()
|
|
|
|
tbls = cur.tables()
|
|
for tbl in tbls:
|
|
print(tbl)
|
|
|
|
cur.execute("SELECT * FROM MSysObjects;")
|
|
for _, _, _, _, _, name, _, _, _, _, data, _, _, _, _, _, _ in cur.fetchall():
|
|
print(name, data)
|
|
|
|
while True:
|
|
cur.execute(input('> '));
|
|
while True:
|
|
row = cur.fetchone()
|
|
if row is None:
|
|
break
|
|
print(row)
|
|
cur.close()
|
|
conn.close()
|
|
|