I created an index with unique values for a schedule. If the time and date and person are the same a warning Pops Up saying:
Error Inserting the new record
Violation of unique index "Appt":duplicate values for columns "DateAppt","TimeAppt","Employee" in statement[Insert INTO "Appointment"....etc]
All that is fine, but the end user of this application will never read all that, is it possible to create a custom message to say for example:
STOP!!! That Date and Time is already booked for Mary!
Thanks
Index Warning or Error Message
Re: Index Warning or Error Message
This isn't problem that is unique to base. The fact is that is you rely on the DB referential model to trap user data integrity errors then the error messages that the DB engine puts out are confusing. If you want to produce meaningful error messages you basically have two options:
- Trap the error and interpret it in order to put out a meaningful error.
- Add additional SQL code to validate the operation before executing the insert and again put out a meaningful error e.g. do a select count(*) from Appointment where DateAppt = ....
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.