在vb中执行存储过程请教,在线急等
我在vb中调用存储过程的时候出错
调用函数为:
Public Function ReCalcData(ByVal STCD As Long, ByVal dteStartTime As Date, ByVal dteEndTime As Date)
Dim localCmd As New ADODB.Command
With localCmd
.CommandText = "p_ReCreate"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("STCD", adInteger, adParamInput, , STCD)
.Parameters.Append .CreateParameter("begin", adDate, adParamInput, , dteStartTime)
.Parameters.Append .CreateParameter("end", adDate, adParamInput, , dteEndTime)
Set .ActiveConnection = cn
.Execute
End With
Set localCmd = Nothing
End Function
cn为有效连接,当程序执行到.Execute,系统提示:“没有执行可选择性”
百思不得其解,请各位指点,在线等候
附:存储过程为:(为有效存储过程,在查询器里试验无误)
create procedure p_ReCreate (
@STCD integer ,
@begin datetime ,
@end datetime)
as