我正在使用 sql server 和 asp classic,目前正在调用这样的查询:
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
但我不想在这里使用查询语句,而是调用一个名为dbo.sp_selectNewHireSQL
. 我怎样才能做到这一点?
谢谢
编辑:
我试过这个
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)
但我得到了-1
记录数的价值。