title: Compare value from database field and check if the same as variable in VB
body: <p>I'd like to ensure that company names don't be added duplicated
  So I would like to check all the records. By removing all kinds of special characters/ Spaces from both values and do compare on both.</p>
  <p>the input for example = &quot;Star Treck, LTD&quot;
  The database for example has the value &quot;star-treck ltd.&quot;</p>
  <p>now I want to remove all special chars that were added to the input and remove all from the db field so that I make sure that this company name won't be allowed to be added again</p>
  <pre><code>' the following is an input given by user to compare with the db records
  
         dim coname : coname = gs(&quot;company name&quot;)
                      coname = replace(coname, &quot;_&quot;, &quot;&quot;)
                      coname = replace(coname, &quot; &quot;, &quot;&quot;)
                      coname = replace(coname, &quot;-&quot;, &quot;&quot;)
                      coname = replace(coname, &quot;(&quot;, &quot;&quot;)
                      coname = replace(coname, &quot;)&quot;, &quot;&quot;)
                      coname = replace(coname, &quot;?&quot;, &quot;&quot;)
                      coname = replace(coname, &quot;&amp;&quot;, &quot;&quot;)
                      coname = replace(coname, &quot;^&quot;, &quot;&quot;)
          if Instr(coname, &quot;'&quot;) &gt; 0 then
               coname = replace(coname, &quot;'&quot;, &quot;''&quot;)
          end if
          dim res
          if coname&lt;&gt;&quot;&quot; then
               res=&quot;SELECT COID FROM COMPANY WHERE (CONAME='&quot;&amp;coname&amp;&quot;') AND (CLOSEDFLD=0 OR CLOSEDFLD IS NULL)&quot;
               if LEFT(res,4)=&quot;ERR:&quot; then
                   msg res
                   exit function
               end if
           end if
  </code></pre>
  <p>now how can I remove all the above special chars / make all chars from both for example uppercase to compare</p>