1

How do make sure that the primary key has one "@" in the column "email" in MS Access database, so it does not save any data without one "@" and throw exception.

I also have one column that saves domain names and it should have one "."

How do I do this validation too?

4

1 回答 1

4
  • 将以下“验证规则”添加到您的字段

    Like "*@*"
    
  • 添加带有描述性错误消息的“验证文本”,例如

    E-mail address must contain at least one @
    

附带说明:我强烈建议不要使用电子邮件地址作为主键。主键用于创建表之间的引用,通常应该是一个不会改变的值。但是,电子邮件地址确实会发生变化。您可能要考虑改用自动编号字段(具有某些优势的所谓“代理键” )。

于 2013-06-18T15:43:56.980 回答