title: ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another
body: <p>I've got an old website that is using ASP Classic and I have recently been asked remove the SQL injection attack threat. I'm trying to use parameterized queries, but it's all a little above my head.</p>
  
  <p>here is my code:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>&lt;% whatSector = request.querystring("whatSector")%&gt;
  
      &lt;%  adoCon.Open cString
          dim rs_client
          if whatSector="" then
      strSQL="SELECT * FROM clients ORDER BY alphabet"
      else
  
      Set objCommand = Server.CreateObject("ADODB.COMMAND")
  
      strCmd1 = "SELECT * FROM clients Where industrySector=? ORDER BY alphabet"
  
      Set objCommand.ActiveConnection = adoCon
          objCommand.CommandText = strCmd1
          objCommand.CommandType = adCmdText
  
      Set param1 = objCommand.CreateParameter ("whatSector",adVarChar, adParamInput, 50)
      param1.value = whatSector
      objCommand.Parameters.Append(param1)
      Set rs_client = objCommand.Execute()
  
      end if 
      set rs_client = server.CreateObject("ADODB.Recordset")
      rs_client.open strSQL,adoCon
  
  %&gt;
  </code></pre>
  
  <p>This seemed to work for me on another page (except for some reason I had to remove a recordCount thing I was using for paging), but I'm getting the following error on this page:</p>
  
  <blockquote>
    <p>ADODB.Recordset error '800a0bb9' </p>
    
    <p>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.</p>
    
    <p>/clients/clientspotlight_list.asp, line 50</p>
  </blockquote>
  
  <p>Line 50 - is the rs_client.open at the end of the above code snippet.</p>
  
  <p>I have used</p>
  
  <pre><code>    &lt;!-- METADATA TYPE="TypeLib" NAME="Microsoft ADO Type Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" --&gt;
  </code></pre>
  
  <p>for adovbs.inc.</p>