title: Classic ASP create parameter MSSQL query syntax not correct
body: <p>I'm creating an interface page which will pull response.querystring in for the person_id and then use that in a query as a parm to look up information.   The below is not working but when I hard code the ID it works.   Something is off on the syntax. </p>
  
  <pre><code>dim id
  dim conn
  dim cmdQuery
  Const adCmdText = 1
  Const adOpenForwardOnly = 0
  Const adLockReadOnly = 1
  Const adVarChar=200
  Const adInteger = 3
  
  set conn = server.CreateObject ("ADODB.Connection")     
  conn.Open "DRIVER={SQL Server};" &amp; _
      "SERVER=xxx.xx.x.xxx,xxxx;" &amp; _
              "UID=sa;" &amp; _
              "PWD=sa;" &amp; _
              "DATABASE=person"
  
  id = 1019438
  set cmdQuery = CreateObject("ADODB.Command")
  set prm = cmdQuery.CreateParameter("ID", adInteger, 1, , )
  With cmdQuery
       Set .ActiveConnection = conn
       .CommandType = adCmdText
       .NamedParameters = true
       Fix:  .Parameters.Append .CreateParameter(prm, adInteger,1, 15, id)
       .CommandText = "SELECT ID, FIRST_NAME, LAST_NAME FROM person WHERE ID = ?"
       .Parameters.Append prm
  End With
  
  set rs = CreateObject("ADODB.Recordset")
  set rs.Source = cmdQuery
  rs.CursorType = adOpenForwardOnly
  rs.LockType = adLockReadOnly
  rs.Open
  </code></pre>