title: How to call a stored procedure using asp classic?
body: <p>I am using sql server and asp classic, and am currently calling queries like this:</p>
  
  <pre><code>newHireSQL = "select * from NewHire where Archived = 0 order by HireID desc"
  
  Set rsGetHireID = Server.CreateObject("ADODB.Recordset")
  rsGetHireID.Open newHireSQL,ConnectionString,adOpenStatic
  
  NumOfHireID = rsGetHireID.RecordCount
  </code></pre>
  
  <p>But instead of having the query statement here, I want to call a stored procedure called <code>dbo.sp_selectNewHireSQL</code>. How can I do that?</p>
  
  <p>Thanks</p>
  
  <p>EDIT:</p>
  
  <p>I tried this</p>
  
  <pre><code>Dim Conn
  SET Conn = Server.CreateObject("ADODB.Connection")
  SET rsGetHireID = Server.CreateObject("ADODB.RecordSet")
  Conn.Open ConnectionString
  set rsGetHireID=Conn.Execute("Exec sp_selectNewHireSQL")
  
  NumOfHireID = rsGetHireID.RecordCount
  Response.Write (NumOfHireID)
  </code></pre>
  
  <p>But I am getting a <code>-1</code> value for the record count.</p>