I have many validation expressions for which that does not work, Arnd. It may actually only work for simple single-quoted strings. That's why I had to make it so complex.
By the way, I added some code after getting the validation string via Describe, to take care of columns with no validation message at all, where it's just the basic data type validation that is firing:
if validation = "?" then
// There was no defined validation, just give a generic message based on the type.
colType = this.Describe(asColName + ".ColType")
if Left(colType, 3) = "dec" or colType = "real" then
return "Please enter a valid amount in this field, if you wish to enter a value in it."
elseif colType = "int" or colType = "long" or colType = "number" or colType = "ulong" then
return "Please enter a valid number in this field, if you wish to enter a value in it."
elseif colType = "date" then
return 'Please enter a valid date in your Short Date Format specified in Control Panel.'
else
return "Please enter a valid value for this field, if you wish to enter a value in it."
end if
end if