Solved

Key violation error

Posted on 2004-04-21
5
1,716 Views
Last Modified: 2012-08-14
I am an end user of a program that uses a Paradox v5 database for the entries.  I have had nothing but problems with this, but most I have been able to fix using the table repair utility.  Recently, we started getting a "Key Violation" error when we try to save a new entry.  I attempted to fix the database and rebuild it, but this error continues to appear.  Note that this has never done this until recently (less than a week ago).  How can I repair this so we can use our program again?  We use this program on a day-to-day basis and I would like to get this repaired ASAP!  Thanks!
0
Comment
Question by:kvalley9599
5 Comments
 
LVL 1

Expert Comment

by:cm_ram23
ID: 10883685
You are trying to reuse a key that is already in the table. Please find out your primary key columns/unique constraint columns that have an existing value for the data that you are trying to insert.
0
 
LVL 4

Expert Comment

by:boxcar7
ID: 10883745
Hmmmm...I couldn't tell you, since the solution *probably* lies in the program, not damage to the database.  

It is possible that there is some internal record counter within the program that writes its information to a unique key.  For example, something that creates invoices has a record of the last invoice number used.   In the invoice table, there may be a field for the invoice number that needs to be unique (there can only be one invoice record with the number #1015, for example).  If somehow, an invoice with #1016 gets written to the table without the program's internal counter of the last invoice record used getting incremented, the program will try to create another invoice #1016 and get a key violation.

In a nutshell, my thought is that the answer is not going to come from repairing the back-end database, but rather from someone who has experience with your specific application.
0
 
LVL 2

Accepted Solution

by:
allinb earned 500 total points
ID: 10895974
You can use Access 2003 to link to the tables and get a look at the data. You will need to download the latest ISAM drivers from Microsoft as there are published TK's in regards to Paradox and the initial release of Access. Once you have a link established to the tables you can scan through the data an perform queries that can help you locate the record and if you have the BDE engine running on your machine you can make the record go away or even repair it with Access, that is if it can be located. Look very closely at the last record or group of records entered if they can be identified.....

Since you are the end user you may want to consider contacting your IT department (You did not mention If you had one) or if your company has a technical resource that they normally contract with to perform this as you will need to be somewhat comfortable with Access to do this type of mining operation.
0
 

Author Comment

by:kvalley9599
ID: 10902354
It seems like the problem is boiled down to the database because we were able to add records to previous copies of the same database.  Unfortunately, even if we are able to use a backup, there are about 200+ records that would need to be re-entered.  Can Access update paradox tables with the newest Jet drivers?
0
 
LVL 2

Expert Comment

by:allinb
ID: 10902434
You have to have the BDE engine installed as a prerequisite as well as the updated ISAM drivers but yes.  Either way you sound like you are going to have to restore from the backup. If you can get access to work like microsoft says it will then you will save yourself the leg work of re-entering 200 orders.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now