Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Error EMRX_ProcessRxEmail:

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-27 : 11:22:45
Error EMRX_ProcessRxEmail: Procedure 'EMRX_ProcessRxEmail' expects parameter '@Email2', which was not supplied.,

Now this really stinks. I checked the calling ASP code:

.ActiveConnection = Cnxn
.ActiveConnection.CursorLocation = adUseClient
.CommandText = "dbo.EMRX_ProcessRxEmail"
.CommandType = adCmdStoredProc

.Parameters.Append .CreateParameter("@ClientID", adInteger, adParamInput, , intClientID)
.Parameters.Append .CreateParameter("@CourseID", adInteger, adParamInput, , intCourseID)
.Parameters.Append .CreateParameter("@xEmailSendDate", adVarchar, adParamInput, 100, mailDate)
.Parameters.Append .CreateParameter("@xEmailSubject", adVarChar, adParamInput, 200, mailSubject)
.Parameters.Append .CreateParameter("@xEmailFromAddress", adVarChar, adParamInput, 100, mailFromAddress)
.Parameters.Append .CreateParameter("@xEmailTo", adVarChar, adParamInput, 100, mailTo)
.Parameters.Append .CreateParameter("@xEmailBody", adVarChar, adParamInput, 2000, mailBodyText)
.Parameters.Append .CreateParameter("@Email1", adVarChar, adParamInput, 100, strEmail1)
.Parameters.Append .CreateParameter("@Email2", adVarChar, adParamInput, 100, strEmail2)
.Execute ,,adExecuteNoRecords

Obviously @Email2 is supplied, and this code has run properly for years now, until one day, when an email arrived with an attachment.

Anyone have a guess as to why this error might be generated when the email has an attachment?

Sam

Kristen
Test

22859 Posts

Posted - 2005-04-27 : 13:37:04
You in an ON ERROR GOTO block that is hiding some simple error in that code?

Kristen
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-27 : 14:19:37
No. And it's not the email attachment. I got rid of that.

It is SOOOOOO difficult to debug these scripts when they run as an SQL job.

I'll post back after I fig'er this'un out.
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2005-04-27 : 23:00:23
Found the problem and it wasn't the email attachment. The "To" email address list length was greater than the 100 characters specified in the ADO above. Truncating the incoming string to 100 characters solved the problem.

I can't fathom why that would lead to ADO throwing the error message I posted above. I'm glad this one's over.

Sam
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-04-28 : 05:11:53
perhaps "Wrap" the .CreateParameter with your own function - so that you can blow-up if a parameter exceeds the limiting length (on the assumption that a blind truncate may cause all sorts of knock on problems!)

Kristen
Go to Top of Page
   

- Advertisement -