title: ASP Classic Named Parameter in Paramaterized Query: Must declare the scalar variable
body: <p>I'm trying to write a parameterized query in ASP Classic, and it's starting to feel like i'm beating my head against a wall. I'm getting the following error:</p>
  
  <blockquote>
    <p>Must declare the scalar variable "@something".</p>
  </blockquote>
  
  <p>I would swear that is what the hello line does, but maybe i'm missing something...</p>
  
  <pre><code>&lt;% OPTION EXPLICIT %&gt;
  &lt;!-- #include file="../common/adovbs.inc" --&gt;
  &lt;%
  
      Response.Buffer=false
  
      dim conn,connectionString,cmd,sql,rs,parm
  
      connectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=.\sqlexpress;Initial Catalog=stuff"
      set conn = server.CreateObject("adodb.connection")
      conn.Open(connectionString)
  
      set cmd = server.CreateObject("adodb.command")
      set cmd.ActiveConnection = conn
      cmd.CommandType = adCmdText
      cmd.CommandText = "select @something"
      cmd.NamedParameters = true
      cmd.Prepared = true
      set parm = cmd.CreateParameter("@something",advarchar,adParamInput,255,"Hello")
      call cmd.Parameters.append(parm)
      set rs = cmd.Execute
      if not rs.eof then
          Response.Write rs(0)
      end if
  
  
  %&gt;
  </code></pre>