Re: [python-win32] datetime values in adodbapi

2017-11-08 Thread Bob Kline
On Mon, Nov 6, 2017 at 5:47 PM, Max Slimmer wrote: > If you don’t mind losing some precision you can do something like this: > ... [code to override dateconverter] ... That would address the first bug, at least for my own immediate application. It would take more digging

Re: [python-win32] datetime values in adodbapi

2017-11-07 Thread Bob Kline
On Tue, Nov 7, 2017 at 10:11 AM, Vernon D. Cole wrote: > Obviously Bob has found a where a value an internal form blows up when fed > directly back into an INSERT. I suspect that if his row.date value was run > through a real datetime object that things would magically

Re: [python-win32] datetime values in adodbapi

2017-11-07 Thread Bob Kline
On Tue, Nov 7, 2017 at 10:49 AM, Dennis Lee Bieber wrote: > >> When running under Python 2.7.13, the first print statement shows that > >> the datetime value has been correctly retrieved, preserving the > >> precision: > >> > >> d=2017-11-04 07:52:18.11 > >> >

Re: [python-win32] datetime values in adodbapi

2017-11-07 Thread Vernon D. Cole
The real question here is where the significance gets lost. It's hard to get a handle on what is really in the tables. Also, the time conversion routines (both in and out of the database) are a mass of confusion. Obviously Bob has found a where a value an internal form blows up when fed directly

Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Tim Roberts
On Nov 6, 2017, at 2:47 PM, Max Slimmer wrote: > > Coincidentally I ran into this issue last week. From what I could gather the > MS SQL data type can accept values with no more than millisecond precision. > This is true using parameterized statements through adodbapi and

Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Max Slimmer
Coincidentally I ran into this issue last week. From what I could gather the MS SQL data type can accept values with no more than millisecond precision. This is true using parameterized statements through adodbapi and also T-SQL and implicit conversion from char to datetime. The type accepts up to

Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Bob Kline
On Mon, Nov 6, 2017 at 10:07 AM, Vernon D. Cole wrote: > [Sorry everyone. My kitten stepped on the keyboard and sent out a one-letter > reply.] Always good to have helpful assistants. :-) > Yes, patches are accepted and welcome. My last remaining Windows > development

Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Bob Kline
On Mon, Nov 6, 2017 at 9:59 AM, Vernon D. Cole wrote: > On Sat, Nov 4, 2017 at 6:27 AM, Bob Kline wrote: >> >> The adodbapi package does not seem to handle datetime values > > Y You hit the Send button too soon, right? -- Bob Kline

Re: [python-win32] datetime values in adodbapi

2017-11-06 Thread Vernon D. Cole
Y On Sat, Nov 4, 2017 at 6:27 AM, Bob Kline wrote: > The adodbapi package does not seem to handle datetime values appropriately. > > import adodbapi > print(adodbapi.version) > cursor = adodbapi.connect(...) > cursor.execute("CREATE TABLE #t (i INT, d DATETIME)") >

[python-win32] datetime values in adodbapi

2017-11-05 Thread Bob Kline
The adodbapi package does not seem to handle datetime values appropriately. import adodbapi print(adodbapi.version) cursor = adodbapi.connect(...) cursor.execute("CREATE TABLE #t (i INT, d DATETIME)") cursor.execute("INSERT INTO #t VALUES (42, GETDATE())") cursor.execute("SELECT * FROM #t") row =