Linux guy seeks help w/MS Access/Python
G. David Kuhlman
dkuhlman at netcom.com
Mon Aug 21 12:59:19 EDT 2000
Download and install the Python MS Windows extension from
www.python.org.
Read about the Python DB API in the DB-SIG at
http://www.python.org/sigs/db-sig/.
Then do something like the following:
>>> import dbi, odbc
>>> connection = odbc.odbc('People')
>>> cursor = connection.cursor()
>>> cursor.execute('select * from People')
0
>>> print cursor.description
[('id', 'NUMBER', 11, 10, 0, 0, 0), ('name', 'STRING', 50, 50, 0,
0, 1), ('phone
', 'STRING', 50, 50, 0, 0, 1), ('street', 'STRING', 50, 50, 0, 0,
1), ('city', '
STRING', 50, 50, 0, 0, 1), ('state', 'STRING', 50, 50, 0, 0, 1),
('zip', 'STRING
', 50, 50, 0, 0, 1)]
>>> rows = cursor.fetchall()
>>> for row in rows: print row
...
o
o
o
>>> cursor.close()
>>> connection.close()
>>>
Albert Wagner (alwagner at tcac.net) wrote:
> I'm on a linux system, but have just taken a job in a windows shop. Is
> there a way to manipulate MS Access within Python? Can you point me
> towards appropriate docs?
>
> --
> We didn't inherit the land from our fathers.
> We are borrowing it from our children.
More information about the Python-list
mailing list