OK. Set objCmd = CreateObject("ADODB.Command") ' Read the recordset of emails to be sent With objCmd .ActiveConnection = ConnString .CommandType = adCmdStoredProc .CommandText = "dbo.EM_SendEmailJob" 'Our Stored procedure .Parameters.Append .CreateParameter ("RETURN_VALUE", adInteger, adParamReturnValue) .Parameters.Append .CreateParameter ("@RecordCount", adInteger, adParamInput, , intMaxRecords) ' 0 = all records, N = Max recordset size .Parameters.Append .CreateParameter ("@Message", adVarchar, adParamInput, 1000, strDisplayMessage) ' 0 = all records, N = Max recordset size .Parameters.Append .CreateParameter ("@EPID", adInteger, adParamInputOutput, , 0) ' Set to zero to read the next recordset Set objRS = .Execute 'Gets an ADO recordset of all the emails End With
strMessage = "This is a new message for the second call" .Execute ,,adExecuteNoRecords ' Execute same command object with revised intEPID to record send duration statistics
Is anything else needed to load strMessage into @Message before the 2nd execution of objCmd?