473,395 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xp_startmail return code checking

xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #1
5 2030
Hi

You don't say what your client is written in! ADO has an errors collection
that should contain the error, see the topic "Handling Errors and Messages
in ADO" for an overview.

John

"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #2
Hi

You don't say what your client is written in! ADO has an errors collection
that should contain the error, see the topic "Handling Errors and Messages
in ADO" for an overview.

John

"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
xp_startmail is documented as returning two code: 0 success, 1 failure.
It would be nice to check the return code.

When mail has already been started it returns a 1. This case appears
indistinguishable from a failure to start. (MSFT should have provided
separate return codes for failure-already started, and failure-cannot
start, but they did not.)

Does anyone know how to distinguish these cases. Text is printed
indicating that it has already been started but I don't know how to
programmatically grab this case.

It seems the conventional workaround is not to check the return code at
all (or to start mail once at server startup and never start it again).
Neither is ideal.

Suggestions?

Thanks,
Mark Andersen

Jul 23 '05 #3
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #4
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #5
Hi

With ADO/ODBC occasions such as when a status of SQL_SUCCESS_WITH_INFO you
can get the messages and interogate them. The options seem to be assume
that SQLMail is running and not start it every time, or to explicity stop it
first ignoring any errors which it throws up.

You may want to look at: http://www.sqldev.net/xp/xpsmtp.htm as a different
way to send emails.

John
"Mark" <ma**********@evare.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
"You don't say what your client is written in!"

No client. This is a SQL Stored Procedure (invoked by a sql job, but
that is irrelevant) in which I wish to call xp_startmail and
distinguish between "failure, already started" and "failure, won't
start".

Did you test it in ADO or are you offering general advice?

Mark

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John Ramsden | last post by:
.... when the id 'junk' doesn't exist anywhere in the document, instead of returning 'object'?! I am using Javascript for a drop-down menu, slightly adapted from one by Angus Turnbull (see...
4
by: thechaosengine | last post by:
Hi all, I have a property called GeneralStatus that can return an int between -1 and 3. These values are represented by an enumeration called StatusEnum. My question is, should my property...
0
by: Mark | last post by:
xp_startmail is documented as returning two code: 0 success, 1 failure. It would be nice to check the return code. When mail has already been started it returns a 1. This case appears...
2
by: Sara Shoemaker | last post by:
Hi all - I am trying to launch a web browser from within my code for Linux. The problem is that I am getting no failure code back when the browser doesn't launch. (I'm trying to force a failure...
7
by: Michael Kennedy [UB] | last post by:
Hi, I am back with more bug reports from Visual Studio.NET 2003's C++ compiler (unmanaged). Consider the following method: --------------------------------------------- __forceinline bool...
38
by: yomgui | last post by:
hello, is it legal to return inside a for loop or am I obliged to break out of the loop before returning ? thanks yomgui
13
by: cppquester | last post by:
A colleague told me that there is a rule about good stype that a function in C++ should have only one point of return (ie. return statement). Otherwise there might be trouble. I never heard about...
173
by: Marty James | last post by:
Howdy, I was reflecting recently on malloc. Obviously, for tiny allocations like 20 bytes to strcpy a filename or something, there's no point putting in a check on the return value of malloc....
8
by: aarklon | last post by:
Hi all, see:- http://linuxgazette.net/issue51/pramode.html
16
by: Joe Strout | last post by:
Let me preface this by saying that I think I "get" the concept of duck- typing. However, I still want to sprinkle my code with assertions that, for example, my parameters are what they're...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.