Tim,
The rude tone of your post overshadows perfectly valid points. We should be
able to discuss theory and philosophy without insults. Please see my comments
below:
Tim Ferguson said:
Not necessarliy. Consider a situation where data has to be entered into a
table, but some of the data is not available. The business rules require
that incomplete records be entered; however, some of the missing data
requires validation. Programmatically it can be allowed, but with
field/table validation, it cannot.
Your response will probably be "Don't allow that". It would be great if it
were that easy. I have been involved in the development of two large
applications where it was required. What we did was create a status field to
mark the record "incomplete" and programmaticly deal with it.
I still maintain that you have more control over the situation with
control/form validation.
Cobblers. Any decent developer will look first at the data structure, and
this includes above all the constraints on unique keys, foreign keys,
check constraints etc.
You left out relationships. They should, but do they always?
Remember that a jet database can be altered by anyone with appropriate
permissions, using a variety of tools from querydefs, VBA, VBS, Word,
PERL, dot-Net etc etc. I wrote a database app in Corel-Draw once using a
mdb to control the data. DB engines are there to protect your data, and
they will do it regardless of where the commands come from.
True, and that is a good case for table/field level validation. I have yet
to be faced with that issue.
This is a joke, right? If you move the database from an mdb, then the
ONLY things you take with you will be the schema. No forms, no VBA, no
BeforeUpdate events. If it's not in the schema then you lose all your
protection.
I was not joking, this is the comment I consider rude. We are talking
backend data, not other frontend objects. If you upsize the backend to a
different database engine, you cannot be certain the rules imposed will be
honored or understood by another engine.
Okay, but not for any of the reasons you are suggesting.
We disagree, Tim. And that is okay. We learn more from those with
differing opinions than those who use the same techniques. Certainly, some
things in database and application design are bad ideas and should never be
done. There are, however, multiple valid ways to accomplish the same goals.
Your post has some valid points and I will do some research and
experimenting with table/field validation. To suggest I am wrong is narrow
minded. Notice I never said table/field level validation is wrong, I only
said I don't use it and I recommend against it.
I can see some value to it in that if you have multiple forms that use the
same table, then you only have to write the rule once.
In any case, I appreciate your comments.