Re: Primary Key Unexpectedly Gone from Table
- From: Simon <Simon@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 16 Nov 2007 09:26:00 -0800
Thanks for the reply, Allen.
I don't understand how the entered data could violate the index when the PK
is an AutoNumber field. The [id] field is not visible on the form and
therefore not a value that is entered by the user.
If the db is split, where does the Function CreateIndexesDAO() in your
example reside?
"Allen Browne" wrote:
See the last symptom of corruption in this article:.
http://allenbrowne.com/ser-47.html#LostKeyRelation
It is actually possible to programmatically create an index on a linked
table, if you OpenDatabase on the back end so you are operating on that file
instead of CurrentDb. You can then CreateIndex on the TableDef, CreateField
and append the fields to the index, set its Primary property ot True, and
append this new index to the tables Indexes collections.
For an example, see:
http://allenbrowne.com/func-DAO.html#CreateIndexesDAO
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Simon" <Simon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C722746-B861-465E-8F55-328C336F5E39@xxxxxxxxxxxxxxxx
Can you tell me if you have ever heard of this happening and why?
The first indication that 'something' is wrong with the db is that users
are
no longer able to enter data into forms whose RecordSource contains this
table (Person) and others. If I look at the Person table, I can see that
there is no longer a Primary Key set. I can re-set the Primary Key to the
[id] field. A month later, users cannot enter into the forms where the
Person table is part of the RecordSource, and I find that the Primary Key
is
missing from the Person table again. What is causing the PK to disappear??
As the db is split, I cannot run any data definition code to set the PK on
linked tables! (right?)
This is a database that has been in production for several years. The db
is
split and both front end and back end are .MDEs. There are absolutely no
data
definition statement in the code that 'could' have eliminated the Primary
Key
for the table(because the tables are linked) DB is Access 2000.
Any ideas on what is happening and why??
I really appreciate any input you may have!
Thanks
Simon
- References:
- Re: Primary Key Unexpectedly Gone from Table
- From: Allen Browne
- Re: Primary Key Unexpectedly Gone from Table
- Prev by Date: Re: Primary Key Unexpectedly Gone from Table
- Next by Date: Re: recall the item for description
- Previous by thread: Re: Primary Key Unexpectedly Gone from Table
- Next by thread: Re: Primary Key Unexpectedly Gone from Table
- Index(es):
Relevant Pages
|