Issue 18608 - wrong data written when entering date into ADO/MDB table
Summary: wrong data written when entering date into ADO/MDB table
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC3
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-25 08:05 UTC by Frank Schönheit
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2003-08-25 08:05:15 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.
Comment 1 Frank Schönheit 2003-08-25 08:06:52 UTC
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.
Comment 2 Frank Schönheit 2003-08-25 08:57:26 UTC
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 ...
Comment 3 ocke.janssen 2003-08-29 10:16:20 UTC
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.
Comment 4 Frank Schönheit 2003-09-01 15:32:04 UTC
fs->oj: see above. It does *not* only affect ADO, but also MySQL and
dBase, so it can't be an ADO bug only.
Comment 5 hans_werner67 2004-02-02 12:16:19 UTC
change subcomponent to 'none'
Comment 6 ocke.janssen 2004-05-13 15:17:32 UTC
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.
Comment 7 ocke.janssen 2004-05-18 09:18:48 UTC
Fixed in cws insight01
Comment 8 marc.neumann 2004-06-15 14:34:41 UTC
reopen
Comment 9 marc.neumann 2004-06-15 14:35:12 UTC
reassign to fs
Comment 10 marc.neumann 2004-06-15 14:35:41 UTC
fixed in cws insight01 -> please verify
Comment 11 Frank Schönheit 2004-06-17 12:13:30 UTC
still happens in CWS insight01
Comment 12 Frank Schönheit 2004-06-17 12:48:42 UTC
re-assign to oj
Comment 13 ocke.janssen 2004-06-28 13:02:23 UTC
This issue describes two bugs. The second one is fixed. Please have a look at
the first one.
Comment 14 Frank Schönheit 2004-06-28 17:09:44 UTC
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 ...
Comment 15 ocke.janssen 2004-06-29 07:47:49 UTC
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
Comment 16 ocke.janssen 2004-06-29 07:54:16 UTC
.
Comment 17 ocke.janssen 2004-06-29 07:54:39 UTC
Please verify.
Comment 18 ocke.janssen 2004-08-13 11:39:08 UTC
.
Comment 19 marc.neumann 2004-11-30 11:03:45 UTC
fixed in master
Comment 20 marc.neumann 2004-11-30 11:03:59 UTC
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