1个回答
展开全部
Dim Cnn As ADODB.Connection
Dim Rs As ADODB.Recordset
Dim Cnn_c As New ADODB.Command
Dim cnn_p As ADODB.Parameter
Cnn.ConnectionString = ConnStr'连接字符串
With Cnn
'.Provider = "MSDASQL"
.CursorLocation = adUseClient
.Open
End With
Set Cnn_c.ActiveConnection = Cnn
With Cnn_c
.CommandType = adCmdStoredProc
.CommandText = "存储过程名"
End With
Set cnn_p = Cnn_c.CreateParameter("ReTurn", adInteger, adParamReturnValue)
Cnn_c.Parameters.Append cnn_p
‘这里添加其他参数
Set Rs = Cnn_c.Execute'执行
'Cnn_c.Parameters("ReTurn")这就是返回值
Rs.close
Cnn.Close
Set cnn_p = Nothing
Set Cnn_c = Nothing
Set Rs = Nothing
Set Cnn = Nothing
Dim Rs As ADODB.Recordset
Dim Cnn_c As New ADODB.Command
Dim cnn_p As ADODB.Parameter
Cnn.ConnectionString = ConnStr'连接字符串
With Cnn
'.Provider = "MSDASQL"
.CursorLocation = adUseClient
.Open
End With
Set Cnn_c.ActiveConnection = Cnn
With Cnn_c
.CommandType = adCmdStoredProc
.CommandText = "存储过程名"
End With
Set cnn_p = Cnn_c.CreateParameter("ReTurn", adInteger, adParamReturnValue)
Cnn_c.Parameters.Append cnn_p
‘这里添加其他参数
Set Rs = Cnn_c.Execute'执行
'Cnn_c.Parameters("ReTurn")这就是返回值
Rs.close
Cnn.Close
Set cnn_p = Nothing
Set Cnn_c = Nothing
Set Rs = Nothing
Set Cnn = Nothing
更多追问追答
追问
谢谢啊 可以接到,但是这是用ADODB,如果改用rdodb连接方式怎么取得呢?!
谢谢啊 可以接到,但是这是用ADODB,如果改用rdodb连接方式怎么取得呢?!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询