开发者

asp question ADODB.Recordset and calling a procedure

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜