Apache OpenOffice (AOO) Bugzilla – Issue 18608
wrong data written when entering date into ADO/MDB table
Last modified: 2006-05-31 14:29:06 UTC
* MDAC 2.7 * english Windows XP, "regional settings" -> "Germany" * english installation of OOo 1.1 RC3 * create a data source pointing to an MDB file, using the ADO type in OOo * create a table containing a DATETIME field (I stumbled upon it with the table structure of issue 18594) * display this table in the data source browser, go to a new record * enter "12.6.2003" in the datetime field, leave the row => the value is corrected to 06.12.2003 Looking into the file with MS Access reveals that indeed the wrong value has been written. The same problem does not appear with a DATE field in MS Access, so I assume it's somehow ADO-specific.
targeting fs->oj: to me it seems as if somehow, the english locale is used in some place, though the (automatic and implicit) formatting for the column is TT.MM.JJ, means a german format.
played with this whole thing (because of issue 18594, which lead to #18608#, #18609#, #18610#, #18611#), and also encountered this problem with * MySQL: when entering a date in the "criterion" row of a date time field in the query design * ADO/MDB, and dBase: when entering a date value in the parameter dialog of a parametrized query (e.g., use the one from issue 18594 for reproducing) fs->oj: we should verify our date handling in all three places (DSB, parameter dialog, query design). I had a real hard time to enter the desired date into the parameter dialog ...
It's a bug in ADO. We put the correct data value into the table, after that we refetch the value from the resultset and we got the month and date value mixed up.
fs->oj: see above. It does *not* only affect ADO, but also MySQL and dBase, so it can't be an ADO bug only.
change subcomponent to 'none'
the method predicateTree doesn't use a default format key when not already set. This leads to a englich default locale, which was wrong. Aftzer using the default number format all seems to be okay. At least for query design. I'l investigate the other places as well.
Fixed in cws insight01
reopen
reassign to fs
fixed in cws insight01 -> please verify
still happens in CWS insight01
re-assign to oj
This issue describes two bugs. The second one is fixed. Please have a look at the first one.
fs->oj: sorry, back to you again: This is not a problem of the FormattedField, as I supposed, but of the ADO driver: - do as said in the original description of this issue - when you entered "12.6.2003" into the cell: - leave the cell with "Tab", instead of leaving the row => the input is corrected to "12.06.2003 00:00". This means that committing the cell content to the underlying row still succeedes. Indeed, I debugged this down to "OLEVariant::OLEVariant( const DateTime& x )", and there the proper date (2004-06-12) is written - now save the row, by either leaving it or pressing the "Save" button => the cell value is changed to "06.12.2003 00:00". This implies that *refetching* the row gives the wrong value. Not sure, though, whether this is and ADO/JetEngine bug, or a problem with out driver ...
The change of month and day seems to be an ADO bug. All what we do is to set a adDBTimeStamp parameter and then refetch the row again and than the value is mixed up (month, and day switched). When entering 13.06.2003 all went well. :-( The second bug with the query design is fixed. Best regards, Ocke
.
Please verify.
fixed in master
Hi, fixed in current developer build -> close. The current developer build can be found at http://download.openoffice.org/680/index.html Feel free to reopen if this issue is not fixed in the developer build. Bye Marc