Link to home
Start Free TrialLog in
Avatar of joeyoungkc
joeyoungkc

asked on

Error Number = -2147467259 --duplicate record

hi,
   I'm having trouble with my asp page, here is the error message that i got:

SQL Statement: INSERT INTO TimeSheet ([Programmer Name], [Date], [Unit Process], [Action], [Time Spent], [Completed], [Comments], [Project Name], [Environment Code], [Administration], [Carpe Number], [Task Name], [Task Description], [Description Name], [UniqueID], [DateCreated]) VALUES ('Myname', '03/24/2003', '', 'Architecture', 1, '', '', 'ProjectName', '', '', 'IT8145', 'PROJ0001', 'Analysis', '0001/5253', 0, '03/24/2003');
VBScript Errors Occured:

Error Number=-2147467259

Error Descr.=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.

Source=Microsoft VBScript runtime error

--------------
Primary Key are Sequence Number ( autonumber,No Duplicate), Programmer Name(Duplicate Ok), Date ( Dupplicate OK)
-----------------------------------------------------------------------------------------
The SQL STATEMENT works fine before I change one of the field,sequence number(autonumber), from "Yes (Duplicate Ok)" to "Yes (No Duplicate)" in the Index field.  After I change that setting, I am getting 10% chance to have that error.
Is there anyone know what happen to my asp page??
Thanks
Joe
Avatar of joeyoungkc
joeyoungkc

ASKER

um...forget it, I set the Primary Key as Sequennce Number only and it works fine.

k, I will remove this question later.
Well, it's pretty apparent you are getting duplicate records (duh).  Is there a chance your page is being submitted more than once with the same data?  Are you performing an insert when you should actually be doing an update (based on an existing record)?

Brett
arbert,
It should be fine if the page submit more than one time becasue everything allow duplicate except Sequence number ( autonumber) and the sequencenumber should generate a new number everytime it add new record.
NO, this page is creating a new record, not update.
Joe
Ok, so why would you want duplicates--If I submit your page 9 times, do you really want my time sheet entered 9times with only a identity field making it unique?

sounds like you're going to have a mess on your hands....
arbert
I can't do anything about it, it is what the system does, there has 19 fields + autonumber and u can have the same values in 18 fields and 1 different value in one field.
This question isn't dicussing about the system's format, it is about how come the autonumber generate a duplicate value.
Keven
ASKER CERTIFIED SOLUTION
Avatar of Banath
Banath

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial