IIS ASP - asp/ado/xp_sendmail/return codes/brain dead

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > July 2005 > asp/ado/xp_sendmail/return codes/brain dead





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author asp/ado/xp_sendmail/return codes/brain dead
Beverley

2005-07-25, 6:06 pm

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
Beverley

2005-07-26, 7:58 am

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
"Beverley" <ali_webitems@hotmail.com> wrote in message news:evDijIXkFHA.3064@TK2MSFTNGP15.phx.gbl...
I think I've lost my mind. This worked earlier today. Apparently I broke something but I have no idea what.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com