title: ASP and ADO error: No value given for one or more required parameters
body: <p>Language is vbscript and classic ASP.</p>
  
  <p>The following SQL works when values are hard coded in the sql statement:</p>
  
  <pre><code>sql = "UPDATE STORE2_ITEM SET sku = 'abcd' WHERE id = 224 and host_id = 1"
  </code></pre>
  
  <p>What I'm trying to do is add parameters so I replaced the field1 assignment with the following:</p>
  
  <pre><code>sql = "UPDATE STORE2_ITEM SET sku = ? WHERE id = 224 and host_id = 1"
  </code></pre>
  
  <p>(keeping it simple for now just to see if I can get this parameter to work).</p>
  
  <p>I get the following error:</p>
  
  <p>"No value given for one or more required parameters."</p>
  
  <p>rest of the code is as follows:</p>
  
  <pre><code>Set DynaDb = Server.CreateObject("ADODB.Connection")
  DynaDB.ConnectionString = STORE_CONNECTION_STRING
  DynaDb.Open
  
  sql = "UPDATE STORE2_ITEM SET sku = ? WHERE id = 224 and host_id = 1"
  
  Set cmd = Server.CreateObject("ADODB.Command")
  cmd.CommandText = sql
  
  cmd.CommandType adCmdText
  cmd.Prepared = true
  
  cmd.Parameters.Append(cmd.CreateParameter("", 200, 1, "AbcD"))
  
  cmd.ActiveConnection = DynaDB
  cmd.Execute
  </code></pre>
  
  <p>Other info:
  Connection String: 
  Provider=SQLOLEDB.1;Data Source=xxxxxxx;Initial Catalog=xxxxxx;Persist Security Info=True;User ID=xxxx;User Id=mkj;PASSWORD=xxxxxx;</p>
  
  <p>EDIT: I removed the code that was giving me a Type Mismatch error as it really wasn't relevant.</p>
  
  <p>EDIT: I removed my answer here and posted it as an "Answer" below.</p>