I want to use ms access db with flask frame work. my question is How to configure it and how to store data in ms access db with json format.
Asked
Active
Viewed 1,833 times
1 Answers
0
This can be achieved by using the pyodbc
library:
Create a connection:
cnxn = pyodbc.connect('"Driver={Microsoft Access Driver (*.mdb)};DBQ=<path to MDB>;"')
cursor = cnxn.cursor()
Select example:
cursor.execute("select user_id, user_name from users")
row = cursor.fetchone()
if row:
print(row)
Delete example:
cursor.execute("delete from products where id <> ?", 'pyodbc')
print('Deleted {} inferior products'.format(cursor.rowcount))
cnxn.commit()
The official documentation with installation instructions can be found here: http://mkleehammer.github.io/pyodbc/

Igor
- 2,834
- 2
- 26
- 44
-
Thanks for quick response, but I asked for ms access database right? – san Jan 20 '16 at 10:23
-
"Driver={Microsoft Access Driver (*.mdb)};DBQ=
;" – Igor Jan 20 '16 at 10:25