[thelist] Calling a sproc from VB

Tab Alleman Tab.Alleman at MetroGuide.com
Wed Feb 4 13:40:13 CST 2004

Anthony Baratta wrote:
> At 10:33 AM 2/4/2004, Tab Alleman wrote:

> Are you doing any error trapping in your SP? e.g.

Yes, after nearly every command I have something like:

	IF @@ERROR!=0
		SET @LastError = @LastError + CAST(@@ERROR AS
varchar(15)) + ' AFTER DELETE tmpHotelInfo.[CrLf]'

And at the end of the sproc I concatenate @LastError with my OUTPUT
string variable.  

Since the OUTPUT string variable returns empty, I figure it must be
hitting a fatal error that causes the sproc to completely fail.

If I did what you did:

IF (@@ERROR <> 0)
         SELECT 0 AS CustomerID, @@ERROR AS SQLErrorLevel, 'Insert
as ErrorMessage

And a fatal error occurred, would I get to see what the error was?
Obviously it wouldn't be in my OUTPUT parameter.  Where would it be?
How can I get my VB app to spit it out?


The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  the 
sender immediately and do not disclose the contents to anyone or make copies.

** eSafe scanned this email for viruses, vandals and malicious content **

More information about the thelist mailing list