Key Violation(Urgenlty)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Walter Thizo
    New Member
    • Oct 2008
    • 13

    Key Violation(Urgenlty)

    Morning Programmers


    I have given project where there is corrupt database in the form of text file , what they need is paradox Boland c++ database that will handle the duplicates of student no and make it primary key on the student table. What i have done so far i was able to extract student no from the file but when i save to my field student_No(Prim ary Key), Error message pop up Key Violation.

    My Question

    How can avoid key Violation because i know it causes by same record that must be unique to its field.?

    Thanks in Advanced
  • ashitpro
    Recognized Expert Contributor
    • Aug 2007
    • 542

    #2
    If it is going to be used as primary key then you must first check whether that student number already present in table.
    Or you can put the things in try catch block and simply bypass the "key violation" exception.

    Regards,
    Ash

    Comment

    Working...