Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel ADO与存储过程调用_Excel_Vba_Adodb - Fatal编程技术网

Excel ADO与存储过程调用

Excel ADO与存储过程调用,excel,vba,adodb,Excel,Vba,Adodb,我正在使用下面的代码,但我的记录集未打开,我做错了什么 Dim rs As New ADODB.RecordSet Dim Conn As New ADODB.Connection Dim cmd As New ADODB.Command Sql = "[dbo].[lc_PM11132_JCCostCashFlow_Report] ?" With cmd .ActiveConnection = Conn .CommandText = Sql .Parameters.Append .Creat

我正在使用下面的代码,但我的记录集未打开,我做错了什么

Dim rs As New ADODB.RecordSet
Dim Conn As New ADODB.Connection
Dim cmd As New ADODB.Command

Sql = "[dbo].[lc_PM11132_JCCostCashFlow_Report] ?"
With cmd
.ActiveConnection = Conn
.CommandText = Sql
.Parameters.Append .CreateParameter("@ReportType", adInteger, adParamInput)
.Parameters("@ReportType") = 1
End With
rs.Open cmd
rs.MoveFirst

您是否在任何地方打开了
连接
?是,连接正常