There are two types of quotes. Regular which look like this (") and fancy as I call them that look like this (”). My guess is you are pasting the second type of quote in to your field. Add that in to your function like this:
Code:
public function CleanQuotes( ByVal strDirty, boolRemove )
strData = Replace( Replace( strDirty, Chr(147), Chr(34) ), Chr(148), Chr(34) )
strData = Replace( Replace( strData, Chr(146), Chr(39) ), Chr(96), Chr(39) )
strDate = Replace(strData, "”", "")
if not CBool( boolRemove ) then
strData = Replace( strData, Chr(39), String( 2, Chr(39) ) )
strData = Replace( strData, Chr(34), Chr(39) & Chr(34) )
elseif CBool( boolRemove ) then
strData = Replace( strData, Chr(39), Chr(32) )
strData = Replace( strData, Chr(34), Chr(32) )
do while InStr( 1, strData, String( 2, Chr(32) ) ) > 0
strData = Replace( strData, String( 2, Chr(32) ), Chr(32) )
loop
end if
CleanQuotes = Trim( strData )
end function
See if that fixes your problem.
Bookmarks