473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Validation rule to block certia works or phrases

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
4 2696
<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
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
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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
3
by: Dalan | last post by:
I apparently need a bit of assistance regarding the structure of some validation code on the BeforeUpdate or AfterUpdate event on a form for several fields that need to controlled. I did search the...
2
by: Joey P | last post by:
Hi all, I am doing a project for university whereby i have to implement a simple database related to a frozen foods company. I am having some trouble though creating a validation rule for one...
3
by: GGerard | last post by:
Hello In a text box, I would like the user to be able to enter only a number from 0 to 100 (including decimals Ex: 24.56) so I wrote this in the Validation Rule Propertie of the text box : >=...
6
by: Chuck | last post by:
A97. A database has a table: tblA which has a single text field, B. It is a primary field, indexed and no duplicates. It is used as a lookup for table tblC. A form based on tblA is used to add...
12
alakazamm
by: alakazamm | last post by:
I am building a database on Access 2000 which include a Customer Details table. In this Customer Details table there is a 'Post Code' field which I am required to make an Input Mask to limit the...
7
by: sharsy | last post by:
Hi guys, I would like to setup a validation rule for a database in microsoft access that restricts data entry so that a certain field can only be filled in if another field has a specific answer...
8
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
4
by: HenrikL | last post by:
Hi. I have a textbox that have a binding on it with converter and validationrules. When a validation error ouccur the foreground of the textbox will change to red cause it has a style.triggers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.