定义adodb.command对象调用存储过程,如果存储过程中参数,还需要定义adoDB,parameter对象。例如:
Dim cmd As ADODB.Command
Dim strResult As ADODB.Parameter
Set cmd = New ADODB.Command
cmd.ActiveConnection = g_ADOConn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "存储过程名"
cmd.Parameters.Append cmd.CreateParameter("输入参数1", adVarChar, adParamInput, 16, “值1”)
cmd.Parameters.Append cmd.CreateParameter("输入参数2", adVarChar, adParamInput,16, “值2”)
cmd.Execute