Removing Primary Keys

  • Thread starter Thread starter Chakey
  • Start date Start date
C

Chakey

I am using Access tables I created from information in the company database
to delete information in the database, modify data in the access tables, and
then append the data into the company database. I need primary keys (it
appears) to delete data with primary keys in the company DB. But, to modify
data in the Access tables I need to remove the PKs to update fields that are
part of the PK.

Is there an automated way (query, macro, VB script) that I can remove the
PKs from the tables in the Access DB? They will always be the same tables.
I am using Access 2003
thanks,
 
If you cannot update the primary key, that is probably because there is a
relational data integrity and NO CASCADE UPDATE. Removing the primary key
(and the relations on it) will 'orphan' records from other tables. As
example, if you have tables:

Authors
AuthorID (pk)


and


BooksAuthors
BookID
AuthorID (relation with Authors.AuthorID)


then, changing Authors.AuthorID in Authors, will NOT change it in table
BooksAuthors (no cascade update) and thus, some books will become without
traceable author.



Bad idea, isn't ?


Probably better to add the CASCADE UPDATE feature to the relations, if that
ever makes sense, to update a primary key.




Vanderghast, Access MVP
 
Back
Top