Access 97 Dates using ODBC

Cy Edmunds cedmunds at spamless.rochester.rr.com
Sat Feb 22 20:48:51 EST 2003


Consider the following code:

import dbi, odbc
import time

dbc = odbc.odbc('sample')
crsr = dbc.cursor()
crsr.execute('SELECT insert_change_date FROM country')
result = crsr.fetchone()
print str(result[0])

Using Access 2000 it prints out:

Wed Feb 12 00:00:00 1997

which is in fact what is stored in the database. However with
Access 97 it raises an exception. (The exact wording of the
exception I can't recall -- this happens at work and I am now
at home. But the gist of it is that the object doesn't support
the str() operation.)

Has anybody seen this problem before? Do you have a
workaround?






More information about the Python-list mailing list