How to validate email addresses in Access?

浪子不回头ぞ 提交于 2019-12-20 01:12:09

问题


I need to validate an email field in a table in Access 2010. I tried:

Is Null OR ((Like "*?@?*.?*") AND
  (Not Like "*[ ,;]*"))

but this did not work.


回答1:


It appears that your database is in ANSI 92 mode, and when you pasted in the rule...

Is Null OR ((Like "*?@?*.?*") AND (Not Like "*[ ,;]*"))

...Access automatically changed Like to ALike, producing...

Is Null Or ((ALike "*?@?*.?*") And (Not ALike "*[ ,;]*"))

The problem is that ALike uses the ANSI wildcard characters, so you need to change the rule to

Is Null Or ((ALike "%_@_%._%") And (Not ALike "%[ ,;]%"))


来源:https://stackoverflow.com/questions/16803858/how-to-validate-email-addresses-in-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!