开发者

asp question ADODB.Recordset and calling a procedure

开发者 https://www.devze.com 2023-02-28 12:34 出处:网络
I have to make an quick update on a legacy asp page never really having done anything with classical asp want to check if this is valid.

I have to make an quick update on a legacy asp page never really having done anything with classical asp want to check if this is valid.

Can I do this:

set conn = server.CreateObject("ADODB.Connection") 
conn.Open ("connection string info")

Set rsIdent = server.CreateObject("ADODB.Recordset")

SQL = "EXEC procedureName @sParam = '" & someVariable & "'"
rsIdent.Open 开发者_StackOverflowSQL, conn
iSome_ID = rsIdent.Fields("ident_value")
rsIdent.Close()
Set rsIdent = nothing

Where procedureName is a stored procedure that accepts a paramter, does some processing and returns a single record in a column called "ident_value"?


@Curtis: See How to call SQL Server stored procedures from ASP.

0

精彩评论

暂无评论...
验证码 换一张
取 消