I am using Delphi 2010 to build a small application that builds a very very simple database in CSV file format. I am using the Jcl and JVCL libraries (TJvCSVDataset, TJvDataSource and TJvDBGrid).
I set up the fields ("Last Name", "First Name" and "Email"), where "Email" is the only with the UniqueKey property.
I added a record then I added a second one, putting the same value under "Email". When I post changes to the DB I obviously get a "Key is not unique" error.
I would like to avoid to the user to enter a duplicate e-mail address in the DB. How can I perform this check?
I have also tried to catch the E:EJvCSVKeyError exception but the only result I got is showing a custom message, while the duplicate value is still appearing in the DBGrid. It would be logical that, upon catching that extension, the field value reverts to blank (or to its previous value, if any).
Thank in advance,