Hi
I have an access database which has a table full of users and their scores and another table full of unacceptable user names.
If a user tries to enter their name as "damn this game" i want the asp to spot that 'damn' is listed in my table (tblSwear) and replace the entire name with "anon".
I read on 4guys from rolla that when using a like statement if u place % around either side of the word u are comparing then it should allow for other characters appearing around the word.
ie '%damn%'
would find "blah-damn-blah"
but for some reason my code below will only detect a user entering purely "damn" despite my use of the % symbol and it will not detect blahdamnblah"
I keep staring at my code and i cant see what the mistake is, i have attached it and the database and files in case any1 has the time to give it a glance.
I will be so grateful for any help.
I have an access database which has a table full of users and their scores and another table full of unacceptable user names.
If a user tries to enter their name as "damn this game" i want the asp to spot that 'damn' is listed in my table (tblSwear) and replace the entire name with "anon".
I read on 4guys from rolla that when using a like statement if u place % around either side of the word u are comparing then it should allow for other characters appearing around the word.
ie '%damn%'
would find "blah-damn-blah"
but for some reason my code below will only detect a user entering purely "damn" despite my use of the % symbol and it will not detect blahdamnblah"
Code:
dim thename
thename=request("rude")
sql = "SELECT * FROM tblSwear WHERE tblSwear.word LIKE '%" & thename & "%'"
'Select * from Tablename where (Firstname) LIKE '%" & FirstNameVar & "%'"
rs.open sql,myconn,3,3
if rs.recordcount > 0 then
response.Write("anon")
else
response.Write(thename)
rs.close
end if
I keep staring at my code and i cant see what the mistake is, i have attached it and the database and files in case any1 has the time to give it a glance.
I will be so grateful for any help.



