Hello,
I am fairly new to the world of programming in VB using SQL Server. I recently took a class in SQL Server and the teacher explained how the user can create user-defined error messages in SQL Server starting at 50001. I have been playing around with this and I can't understand how to trap that error in VB. For example I created a stored procedure that uses the RAISEERROR. I use 10 as the severity level. When I execute the stored procedure in VB I do not get the error message. If I up the severity level to 16 VB errorhandling will take over and my error routine will display the message. The question I have is: I set the error message in SQL to severity level 11 or above so that VB will reconize the error, how can I tell that it is a user-defined error and not a severe SQL error. I need to know this so I will know to just display a message for the user or display the message and then crash the application.
Thanks in advance,
UncleT
I am fairly new to the world of programming in VB using SQL Server. I recently took a class in SQL Server and the teacher explained how the user can create user-defined error messages in SQL Server starting at 50001. I have been playing around with this and I can't understand how to trap that error in VB. For example I created a stored procedure that uses the RAISEERROR. I use 10 as the severity level. When I execute the stored procedure in VB I do not get the error message. If I up the severity level to 16 VB errorhandling will take over and my error routine will display the message. The question I have is: I set the error message in SQL to severity level 11 or above so that VB will reconize the error, how can I tell that it is a user-defined error and not a severe SQL error. I need to know this so I will know to just display a message for the user or display the message and then crash the application.
Thanks in advance,
UncleT