By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Validation rule to block certia works or phrases

P: n/a
ron
I have a access based guest book. I want to create a validation rule to
block certain words or parts of a srting. How do i do this?

ie: this is a nice site. come visit my porn site at www.abc.zy

If the message contains the word porn, can I block the whole message
using a validation rule

Mar 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<ro*@segl.ca> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I have a access based guest book. I want to create a validation rule to
block certain words or parts of a srting. How do i do this?

ie: this is a nice site. come visit my porn site at www.abc.zy

If the message contains the word porn, can I block the whole message
using a validation rule

While you could have a validation rule such as:
Not Like "*porn*" And Not Like "*sex*"
A validation rule really is not the place to do it. You don't say what you
have used to create the web pages, but if this was ASP, then if a user
entered an offending word, an error would be generated when the table could
not be updated. Sure you can catch this error, but if you're going to do
that you might as well catch the error before it happens and let your web
page say "I can't create an entry because you have used the word x".
Another reason not to do it like this, is that your database and website
should not need constant updating to if you want to add a word to the banned
list. You should not have to take the database offline and change the
validation rule each time you think of something new.

As a final point, if the site is accessible to the whole wide world with no
login, then it will be impossible to ensure you never have content posted
which might offend someone. You might do better focussing on making it
easier for yourself to remove unwanted entries.
Mar 29 '06 #2

P: n/a
ron
if I use the "Not Like sex" validation rule, will the whole comment be
disallowed if they use the word sex in a sentence or will it just block
the word "sex"?

Mar 29 '06 #3

P: n/a
ro*@segl.ca wrote:
if I use the "Not Like sex" validation rule, will the whole comment be
disallowed if they use the word sex in a sentence or will it just block
the word "sex"?

No.

Would it not be best to send the sentence string to something and parse
out each word and /arse out/seek any words are "offensive" and either
return a true/false based on the search result?
Mar 29 '06 #4

P: n/a
<ro*@segl.ca> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
if I use the "Not Like sex" validation rule, will the whole comment be
disallowed if they use the word sex in a sentence or will it just block
the word "sex"?

Try it on a test database. If you have:
not like "*sex*"
then sex cannot appear anywhere in the field.

This will stop people writing "Essex" and "Sussex" but not stop anyone
writing "CUM SEE MY S3X SITE"

You may be fighting a losing battle.
Mar 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.