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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Suppress Error MSG !

Author  Topic 

trusted4u
Posting Yak Master

109 Posts

Posted - 2003-04-23 : 02:02:38
Hello friends :
How to suppress an error msg ?
I am using vb which calls a stored procedure. This sp checks the @@error's value. If it is 547 i.e.violation foreign key constraint, I return 1 in the output parameter.
But when I call this sp through vb, it does not suppress the error msg, instead displays the error in msgbox. Can somebody provide a solution for this ?

Thanks.
-Marjo.

SamC
White Water Yakist

3467 Posts

Posted - 2003-04-23 : 07:39:37
It's hard to help if you don't post your code...

Sam

Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-04-23 : 09:39:26
Add this before the line in which you call the SP


On Error Resume Next 'Supress Errors

MyCommand.Execute

On Error GoTo 0 'Dont forget to reset the Error handling!

If prmReturnValue = 1 then 'Error
''SHOUT
End if



OS


Go to Top of Page
   

- Advertisement -