asp/ado/xp_sendmail/return codes/brain dead

B

Beverley

I think I've lost my mind. This worked earlier today. Apparently I broke something but I have no idea what.

I have a stored procedure that builds and sends an email using xp_sendmail. It is called after the user makes a change to a form (it tells the support centre that a change has occurred.)

The last bit of my SP is this:
-- It fails if it has no recipient list
if isnull(@recip, '') = '' set @recip = @supportemail

declare @rc int -- have also tried changing it to bit

exec @rc = master..xp_sendmail
@recipients = @supportemail
, @message = @msg
, @subject = @subj
, @no_output = 'False'
, @query = @q
, @width = 200

/*
Return Code Values
0 (success) or 1 (failure)
*/

select @rc
return @rc
If I call it through query analyzer, @rc is 0 and I receive the email.
If I call it through my ASP page (which worked earlier), cint(rs.fields(0)) is -1 and I do not get the email.

strSQL = "exec pr_EmailNotification " & iRequestID
writeline "<P>" & strSQL

set rs = ConnObj.Execute (strSQL)
writeline "<P> Result: " & cint(rs.fields(0)) '0 (success) or 1 (failure)

(All variables are declared.)

It was working earlier, I had proven it... I thought it was the return @rc line that was doing it and was just keeping in select @rc for debugging. When I was ready to move on, I removed my debug statement, and then it started failing. I've put it back in, but it still fails, so I must have also removed something else, or changed something, or something.

I'm at wits end. It still works perfectly through Query Analyzer. But not ASP.

Any suggestions would be appreciated.

Beverley
 
B

Beverley

Okay, I've found my mind.

I forgot I moved a piece of the code in the middle of my SP out to another SP. And the user account being used by the ASP page didn't have access to it, although I did under my own personal ID on Query Analyzer.

All's well, thanks for your time :)

Beverley
I think I've lost my mind. This worked earlier today. Apparently I broke something but I have no idea what.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top