odbc DbiDate date conversion

flupke flupke at nonexistingdomain.com
Wed Sep 27 08:04:26 EDT 2006


Frank Millman schreef:
<snip>

> Not that I know of. The results of my investigations so far seem to
> indicate that we have a problem :-(
> 
> Here is a link to an article dated 1998 -
>     https://svn.python.org/www/trunk/pydotorg/windows/OdbcHints.html
> 
> Among other interesting stuff, it states -
> 
> "Notice that result values are converted to Python objects. Dates in
> particular are returned as dbiDate objects. This can be a serious
> limitation, because dbiDate can not represent dates prior to the UNIX
> epoch (1 Jan 1970 00:00:00 GMT). If you try to retrieve earlier dates,
> you'll get garbage and may even provoke a crash."
> 
> I contacted Mark Hammond, author of the win32 extensions, to ask if
> there was a solution and particularly to suggest a modification to
> return a datetime.datetime object. This was his reply -
> 
> "I'd be happy with an option to use the datetime module - maybe it
> could even be on the cursor?  However, I wont have time to do this in
> the short term.
> You could consider using ADO via win32com too..."
> 
> It looks as if we will have to use ADO for now. There is an 'adodbapi'
> module available which is DB-API 2.0 compliant -
> adodbapi.sourceforge.net. I will give it a try.
> 
> Frank

Frank,

thanks for your effort. Looks indeed like it's not going to be solved in
the short term. I will give adodbapi a whirl then.

Thanks,
Benedict



More information about the Python-list mailing list