in Access there is really no table level validation, there is
column level validationand row level validation. To have table level validation, you'd need
check constraints, which isn't supported through
the Access interface.
Well, CHECK constraints can be created and maintained using the Access
interface via SQL DDL code and, being engine-level constraints, data
entered via the interface (and everywhere else) gets checked against
such constraints. So 'support' indeed exists but I would agree they
are not 'exposed' well in the Access interface.
I think there are some fundamental problems to exposing CHECK
constraints in the Access interface. Have you ever wondered what a
table level CHECK constraint expression builder would look like? Let's
face it, the Access Query builder tool thing cannot write subqueries
and what truly table level CHECK constraint would not involve a
subquery?! Also, the interface has a 'hard-coded' assumption of a one-
to-one relationship between column and validation rule, ditto for row
but, worse, it's referred to as the Table Validation Rule and is
exposed in the table properties! Obviously, a table can have more than
one CHECK constraint.
So I think leaving their creation and maintenance to those who can
write SQL is probably for the best. One 'nice to have' would be the
definition of the failure message (ditto other flavours of constraint
e.g. PK and FK), as is the case with Validation Rules. But I think
it's essential that copying a table's 'structure' using the Access
interface should also copy its CHECK constraints and I consider this
omission a bug. And what conclusions can we draw from the fact that
Access Help has no mention of CHECK constraints? (merely poor
editorship, IMO).
Jamie.
--