Issue 5450 - ADO/ Access Autoincrement fails
Summary: ADO/ Access Autoincrement fails
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.0.0
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: christoph.lukasiak
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-31 10:55 UTC by finalfiler
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

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


Attachments
bug doc (14.49 KB, application/zip)
2003-04-29 08:05 UTC, Frank Schönheit
no flags Details
Small form demo of problem, as requested (59.79 KB, application/octet-stream)
2003-04-29 08:14 UTC, finalfiler
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description finalfiler 2002-05-31 10:55:34 UTC
I have created a form that uses a table from an Access database. The primary key
is based on an autoincrementing integer. The connection is through ADO 2.6 and
later and JET 4.  

When a new record is created, the record cannot be saved because the
autoincrementing value is not generated but remains null.
Comment 1 Frank Schönheit 2002-05-31 11:17:19 UTC
The value is to be generated by the database backend, not by the
frontend (means not by OOo).
I darkly remember that we had a bug that we wrote NULL into the
autoinc field before saving, instead of leacing it intouched (which
would be the correct way).

Pierre, What exactly means "cannot be saved"? How does this manifest?
I _suppose_ you get an error message, do you? What is the text of this
error message?
Comment 2 finalfiler 2002-06-01 00:47:41 UTC
FS wrote "Pierre, What exactly means "cannot be saved"? How does this
manifest? I _suppose_ you get an error message, do you? What is the
text of this error message?"

FIrst off, sorry about my poor choice of phrase. I work extensively
with Delphi and ADO so appreciate that the database backend generates
the autoinc. I also believe that (in Access at least) the number is
generated when the new record is saved, ie the value is NOT available
when the new record is created. This, I suspect, my be the problem
especially if the OOo form expects the value on the New record event. 

Specifically in respect of the error OOo gives, it is 
"ERROR WRITING DATABASE - Required input field <fieldname> requires
value. Please enter value"

<fieldname> is, of course, the autoincrementing field. Entering a
valid value will save the record but that isn't practical in a larger
and busy database.



Comment 3 dirk.grobler 2002-07-24 10:34:12 UTC
Hi Frank,

please follow up  on this issue,

Dirk
Comment 4 Frank Schönheit 2002-07-24 13:02:51 UTC
Marc, can you reproduce this?
Comment 5 fatfool 2002-10-16 10:31:29 UTC
Hi,

in addition to the problems already reported, I'd like to add the following 
scenario (Access database through ODBC):

Create a table with an auto-increment 
key field and a text field.
Create a OOo form linked to this table with only the text 
field on the form.

The behaviour I would expect would be that when entering a new 
record in the text field, the autoincremental key field would automatically be taken 
care of by Access.  Instead I get an error "Error inserting the new record " with 
"[Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast 
specification (null)".

The only way to get out of the field is to undo the data 
entry, but then OOo crashes.
Comment 6 marc.neumann 2002-11-28 07:35:02 UTC
reassign to clu@openoffice.org
Comment 7 christoph.lukasiak 2002-11-28 10:20:05 UTC
clu->oj: can repro it on 644o

1. create an Access ADO source with url:
PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA 
SOURCE=T:\Teams\QA\DatabaseAccess\Testplan_Requirements\db-
types\access\testdb.mdb
2. open table in beamer: Bug-Isz-5450 and insert anything in field: 
text and leave the row

-> Info: Error inserting the new record
The field 'autoinc' cannot contain a Null value because the Required 
property for this field is set to True. Enter a value in this field.
Comment 8 ocke.janssen 2002-11-29 12:25:23 UTC
I fixed our ADO implementation.

Best regards,

Ocke
Comment 9 finalfiler 2003-04-19 09:39:58 UTC
I note this problem persists in OOo v1.03 and 1.1 beta, also the
implication of the previous comment is that the matter is supposed to
be fixed.

Is this matter still getting attention?

BTW, same problem with mySQL databases :(

Comment 10 ocke.janssen 2003-04-29 07:35:25 UTC
Hello Pierre,

I could not reproduce the bug in a new version. May be this depends on
the version of MDAC you use. Could you please try the same with the
MDAC version 2.7? And if you still could reproduce it, please attach a
simple form and a sample mdb file with just this table.

Best regards,

Ocke

Comment 11 ocke.janssen 2003-04-29 07:39:55 UTC
Hello Mark,

the problem with Access and ODBC is that you could create tables which
contain auto increment fields, but the driver never tell you again
that this column was an auto increment one. So auto increment columns,
Access and ODBC do not work well with each other :-(


Best regards,

Ocke
Comment 12 Frank Schönheit 2003-04-29 08:05:47 UTC
Created attachment 5948 [details]
bug doc
Comment 13 finalfiler 2003-04-29 08:14:11 UTC
Created attachment 5950 [details]
Small form demo of problem, as requested
Comment 14 Frank Schönheit 2003-04-29 08:15:38 UTC
(for the records: related issue 13926 submitted during investigating this)
Comment 15 ocke.janssen 2003-07-07 06:56:55 UTC
Set target
Comment 16 hans_werner67 2004-02-02 12:54:42 UTC
change subcomponent to 'none'
Comment 17 ocke.janssen 2004-02-10 13:57:37 UTC
Marc,

could you please verify that the bug doesn't occur anymore with a new ver of the
MDAC.

Tanks,

Ocke
Comment 18 christoph.lukasiak 2004-03-02 17:14:47 UTC
rather my turn
Comment 19 christoph.lukasiak 2004-03-03 13:07:38 UTC
tried autoincrement with Acess data source over ADO with mdac 2.7 on an 1.1 oo
and it works fine -> means: this bug is fixed - each other problem, if still
exist, should have place in an other task
Comment 20 christoph.lukasiak 2004-03-03 13:08:49 UTC
close