title: CLASSIC ASP INSERT statement with parameters
body: <p>I have to mantain a ASP 3.0 website...</p>
  
  <p>And I would like to protect sql statements.</p>
  
  <p>The select statements I could protect with this code:</p>
  
  <pre><code>set cmd = Server.createObject("adodb.command")
  
  cmd.commandText = "select from Foo where id=?"
  
  set cmd.activeConnection = someConnection
  
  set rs = cmd.execute(rows_affected, Array(42))
  </code></pre>
  
  <p>But I can't make it to work when I replace the select by update or insert statements.</p>
  
  <p>Can anyone help me?</p>
  
  <p>the code i am trying is:</p>
  
  <pre><code>sqlS1 = "INSERT into users (nome2) values (?)"
  
  arParams = 1
  
  set cmd = createobject("ADODB.Command") 
  
  cmd.CommandText = sqlS1 
  
  cmd.ActiveConnection = session("bdc")
  
  cmd.Execute(,arParams,adExecuteNoRecords)
  </code></pre>