[AccessD] Problem Writing to table

jack drawbridge jackandpat.d at gmail.com
Thu Oct 20 15:02:42 CDT 2016


Rocky,

3022 is usually very definite ---duplicate.

How are you ensuring records are in a specific physical location???
Records are placed randomly (at least by algorithms I don't thiink I can
control). I always regard records in tables as "junk in a box". If you want
to process them in a specific order, use a query with an Order By.

Good luck.

On Thu, Oct 20, 2016 at 3:53 PM, Rocky Smolin <rockysmolin at bchacc.com>
wrote:

> Dear List:
>
>
>
> This is a problem with an mdb running on A2010.  Although I don't think
> that
> may be relevant.
>
>
>
> I am getting an error 3022: The changes you requested to the table were not
> successful because they would create duplicate values in the index, primary
> key, or relationship."
>
>
>
> The scenario:
>
>
>
> I have a table (Table 1) I need to operate on and depending on the record,
> either add some records to Table 1 right after the record in question or
> just go on to the next record.
>
>
>
> The added records have to be in a specific order merged with the existing
> records - can't just add to the end of the Table 1.  So I copy all the
> records to a temp table (Table 2), which has the identical structure as the
> Table 1.
>
>
>
> Both tables have autonumber PKs. Both table have identical structures.
> Except for the PK no fields are indexed.  When I copy from Table 1 to Table
> 2, I select all the fields in Table 1 except for the PK.
>
>
>
> Then I loop through Table 2 table either 1) adding the record from Table 2
> to Table 1 using an INSERT statement, or add some additional records to
> Table 1 and do not copy the record from Table 2 to Table 1.
>
>
>
> After about 60 or so records added to Table 2, I get the error.
>
>
>
> Since the only indexed field is the autonumber PK, I can't see how a
> duplicate value could be generated.  But it is.  So that means something
> else is going on here but I can't imagine what.
>
>
>
> Has anyone encountered this before or have any ideas how to get around it?
>
>
>
>
>
> MTIA
>
>
>
>
>
> Rocky Smolin
>
> Beach Access Software
>
> 760-683-5777
>
>  <http://www.bchacc.com> www.bchacc.com
>
>  <http://www.e-z-mrp.com> www.e-z-mrp.com
>
> Skype: rocky.smolin
>
>
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list