title: How to call a stored procedure in asp classic?
body: <p>In my asp code I want to call a stored procedure. This is the code that I have that is working:</p>
  
  <pre><code>newHireSQL = "EXEC sp_selectNewHireSQL"
  Set rsGetHireID = Server.CreateObject("ADODB.Recordset")
  rsGetHireID.Open newHireSQL,ConnectionString,adOpenStatic
  </code></pre>
  
  <p>However I don't want to write it like that. I want to use this code:</p>
  
  <pre><code>Dim Conn
  SET rsGetHireID = Server.CreateObject("ADODB.RecordSet")
  SET Conn = Server.CreateObject("ADODB.Command")
  Conn.CommandText = "sp_selectNewHireSQL"
  Conn.CommandType = adCmdStoredProc
  Conn.ActiveConnection = ConnectionString
  Set rsGetHireID = Conn.Execute
  </code></pre>
  
  <p>But for this code, I get a record set that has a record count of <code>-1</code>.</p>
  
  <p>Does anyone know why this could be happening and how to fix it?</p>
  
  <p>Thanks.</p>