duplicate index error?

  • Thread starter Thread starter middletree
  • Start date Start date
M

middletree

My database has never given me this problem beofre, in the few weeks since I
have been building it. 9 tables, but 4 are static, and 4 are composites of
just 2 fields (1 each from two different tables), built just for
normalization. Other than those 4, the PK of each table is an autonumber.

Using Access 2000; I built an ASP page, and it worked fine, when I clicked
the submit button, it added data that it was supposed to. However, I added
some email code to the ASP, which shouldn't affect the inserts, but now I
get this error:

Error Type:
Microsoft JET Database Engine (0x80004005)
The changes you requested to the table were not successful because they
would create duplicate values in the index, primary key, or relationship.
Change the data in the field or fields that contain duplicate data, remove
the index, or redefine the index to permit duplicate entries and try again.
/grace/shapethankyou.asp, line 128


where line 128 is simply the line that says to execute the SQL:
INSERT into PersonalGift(PersonalID,GiftID) VALUES(168,12)

where personalgift is one of those composite tables I was talking about.

I cleared out the tables (other than the static ones) right before executing
this the 2nd time, just to see if that would help, but it didn't.
 
either the insert is trying to insert 2 values that already exist, or it is
executing more than once. Can you check for 168 and 12 before the insert to
see if they exist (or look in the table directly)
 
tried to, and got the same error. However, because of my other problem, I
can't even do that now.
 
Back
Top