2013-05-29 32 views
2

我需要驗證在Access 2010中的表我嘗試過的電子郵件字段:如何驗證Access中的電子郵件地址?

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

但這並沒有工作。

enter image description here

+0

請說明您的意思是「沒有工作」。我只是嘗試了驗證規則(這似乎來自[這裏](http://allenbrowne.com/ValidationRule.html)),它適用於最常見的情況。這不是防彈的,但我相信這對於大量的應用程序來說已經足夠了。 –

回答

3

看來,您的數據庫是ANSI 92模式,當你在規則粘貼...

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

...訪問自動更改LikeALike,生產...

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

的問題是,ALike使用ANSI通配符,所以你需要更改規則爲

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