Enforcing constraints lazarus / 16-Databases ---------------------------------------------------------------------- kpeters58 · 2015-04-21 16:55 The fact that TField's CustomConstraint and ConstraintErrorMessage are not yet implemented, makes dealing with missing values that much more cumbersome. The default message that is generated, while technically correct, is designed to scare the crap out of people running the program with its additional warning: 'Press OK to ignore and risk data corruption. Press Cancel to kill the program.". My question is: How do you guys handle NOT NULL constraints in your programs? I am currently using the CaptureExceptions property and the OnException handler from TApplicationProperties to centrally handle these, but am wondering if there are better ways... PS: Using the SqlDB framework ---------------------------------------------------------------------- taazz · 2015-04-21 17:17 have you seen the events of the query? especially the onupdateerror, onediterror, and onPostError? ---------------------------------------------------------------------- kpeters58 · 2015-04-21 17:57 Probably the first method I tried out - I am a big believer in simple, clear & techo-speak free error messages for the users of my programs. Thus I'd have to parse the component names out because they should not be visible as they provide no value at all to end users - they are confusing at best. The moment I do that, I make my programs vulnerable to framework changes because my parsing might fail should someone alter the format of the database exceptions - I'd much rather have working CustomConstraints or something else....