先感谢您。我正在尝试从接受输入参数的 excel 运行存储过程,它给出了错误运行时错误“-2147217900 (80040e14)”自动化错误。
Set cmd1 = New ADODB.Command
With cmd1
.ActiveConnection = sConnString
.CommandText = "spGetPriceChangeTest"
.CommandType = adCmdStoredProc
.CommandTimeout = 360
.Parameters.Append .CreateParameter("@suppliercode", adVariant, adParamInput, , Range("A" & (x + 2)).Value)
.Parameters.Append .CreateParameter("@date1", adDBTimeStamp, adParamInput, , datetime)
.Parameters.Append .CreateParameter("@proddescription", adVariant, adParamInput, , Range("D" & (x + 1)).Value)
.Parameters.Append .CreateParameter("@vendorcode", adVariant, adParamInput, , Range("C" & (x + 2)).Value)
.Parameters.Append .CreateParameter("@type", adVariant, adParamInput, , Range("B" & (x + 2)).Value)
End With
Set rst1 = New ADODB.Recordset
Set rst1 = cmd1.Execute