mxODBC chokes on dates! Any Help?
Owen Ap Owen
no at thank.you
Fri Mar 30 10:55:45 EST 2001
I'm using mxODBC from Python 2.0 under Win32. I have a functional ODBC
connection but when I try to select data that includes date fields mxODBC
chokes.
Here's what I'm doing.
>>> import mx.ODBC.Windows
>>> import mx.DateTime
>>> conn = mx.ODBC.Windows.connect('JTech',user='tech',password='tech')
>>> cur = conn.cursor()
>>> cur.execute('SELECT jci_num, test_date, weight, standard_25 FROM
zwick_data')
>>> from pprint import pprint
>>> pprint(cur.description)
(('jci_num', 12, None, None, 30, 0, 0),
('test_date', 11, None, None, 23, 3, 1),
('weight', 5, None, None, 5, 0, 1),
('standard_25', 6, None, None, 15, 0, 1))
>>> data = cur.fetchall()
Traceback (innermost last):
File "<interactive input>", line 1, in ?
InternalError: ('S1003', 0, '[Microsoft][ODBC Driver Manager] Program
type out of range', 3013)
I've tried this using three seperate ODBC dsn connections. In every case
I get a "Program type out of range" error whenever I try to select any
data that includes a date field.
If I connect to the ODBC connection using any other method besides mxODBC
I can fetch the date fields without a problem.
Am I missing something obvious? Any suggestions?
More information about the Python-list
mailing list