' Our user may not have specified any bad words or they may have
' deleted all words from the database. If this is the case then we
' need to make sure we check for it so we don't crash the system
' when the user writes a new chat line
' If there are no swear words to replace
If rsCommon.eof then
' Do whatever is needed here
' There are records to return so pull them out of the db and convert
' into an array using getRows()
Else
' Set a variable to hold the current msg value
strTempMsg = msg
swearFilterArray = rsCommon.getRows()
For x = 0 to uBound(swearFilterArray, 2)
msg = replace(msg, swearFilterArray(1, x), swearFilterArray(2, x))
Next
' End the db record check
End If
' Close the recordset
rsCommon.close
' Now we can do a check to see whether or not the message contained
' any swear words.
' If the variables differ, this means a swear word has been replaced.
' This means that we can update the database to say that the user
' entered a swear word
If strTempMsg <> msg then
' Do the update here
End If