[thelist] ADO Question

Sam scforum at iness.com
Wed Feb 9 18:15:05 CST 2005


I have the following ASP / ADO code:

    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

... some other code here, then I want to execute objCmd again, with a 
different value for strDisplayMessage

            strDisplayMessage = "hello"
            .Execute ,,adExecuteNoRecords ' Execute same command object 
with revised intEPID to record send duration statistics

Is there a .Parameters method to Update the value of @Message or do I 
need to destroy and recreate objCmd?

Sam





More information about the thelist mailing list