sql - How to call a stored procedure using asp classic? -


i using sql server , asp classic, , calling queries this:

newhiresql = "select * newhire archived = 0 order hireid desc"  set rsgethireid = server.createobject("adodb.recordset") rsgethireid.open newhiresql,connectionstring,adopenstatic  numofhireid = rsgethireid.recordcount 

but instead of having query statement here, want call stored procedure called dbo.sp_selectnewhiresql. how can that?

thanks

edit:

i tried this

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) 

but getting -1 value record count.

it's use exec or execute statement:

set conn = server.createobject("adodb.connection") conn.open connectionstring conn.execute "exec sp_selectnewhiresql" 

reference: http://msdn.microsoft.com/en-us/library/ms188332(v=sql.90).aspx


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -