我正在使用下面的代码,但记录集未打开,我在做什么错了?
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