mxODBC chokes on dates! Any Help?

M.-A. Lemburg mal at lemburg.com
Tue Apr 3 13:36:43 EDT 2001


Owen Ap Owen wrote:
> 
> 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?

Please check out the latest version (2.0.1). This version includes
a work-around for the problems the MS ODBC manager has with the
ODBC 3.5 C type codes for date/time values.

PS: I'm not reading this newsgroup on a regular basis. If you
run into problems, please send the reports to support at egenix.com
or mal at lemburg.com

Thanks,
-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/




More information about the Python-list mailing list