473,405 Members | 2,141 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,405 software developers and data experts.

Raise Error problem when connecting to SQL Server through ODBC

2
Hi,

I have a VB.Net system that connect to SQL Server through ODBC. When I try to raiseerror from an IF...ELSE statement, it does not triggered the exception handling.

I have done some raise error testing at my side. Below is my finding:

1. RaiseError did not triggered exception:

Expand|Select|Wrap|Line Numbers
  1.        CREATE PROC xxx
  2.        AS
  3.          IF 1=1
  4.            BEGIN
  5.              raiserror (70000,15,15)
  6.            END

2. RaiseError triggered exception:

Expand|Select|Wrap|Line Numbers
  1.        CREATE PROC xxx
  2.        AS
  3.          IF 1=1
  4.            BEGIN
  5.              raiserror (70000,15,15)
  6.              raiserror (70000,15,15)
  7.            END
Expand|Select|Wrap|Line Numbers
  1.        CREATE PROC xxx
  2.        AS
  3.        BEGIN
  4.          raiserror (70000,15,15)
  5.        END

Any idea why it does not work in IF...ELSE statement?

Thank you.

KC
Nov 10 '09 #1

✓ answered by ck9663

It managed to work on mine. Here's the error that returned:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Msg 18054, Level 16, State 1, Procedure xxx, Line 6
  3. Error 70000, severity 15, state 15 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
  4.  
  5.  
Happy Coding!!!


--- CK

3 4093
ck9663
2,878 Expert 2GB
It managed to work on mine. Here's the error that returned:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Msg 18054, Level 16, State 1, Procedure xxx, Line 6
  3. Error 70000, severity 15, state 15 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
  4.  
  5.  
Happy Coding!!!


--- CK
Nov 10 '09 #2
kctan
2
Hi ck9663,

The testing is done in Sql Server Query Windows/Pane right?
This testing works on my side too.

But when I connect VB.NET system through ODBC to SQL Server, the raise error inside IF statement does not work. No exception is triggered.

Thank you.

KC
Nov 11 '09 #3
ck9663
2,878 Expert 2GB
Here, read this...

Happy Coding!!!

--- CK
Nov 11 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Kong Li | last post by:
Follow up to this thread, the latest Oracle 9i release 2 patchset (9.2.0.5) fixed the handle count leak problem. The problem is in Oracle client component. Thanks. Kong ----- From: Kong...
3
by: kamilla | last post by:
I have a mysql 3.5 server installed on a suse linux 8.1, with address 10.0.0.100. Now I want to access that db from a W2K pc, address 10.0.0.200. I am able to ping 10.0.0.100, but I cannot connect...
4
by: MNC | last post by:
I'm using Access2002, and can't seem to get an updateable recordset going :-( What am I doing wrong, here's the code. The form's controls are not locked, the recordset type is Dynaset (changing...
1
by: effendi | last post by:
Hi I downloaded MSDE2005 and I tried to set up an ODBC connection to a database I created. I can see the database using client but I got this error through the ODBC manager An error has occurred...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
4
by: shsandeep | last post by:
We are trying to connect from DataStage to a DB2 database on Z/OS. It connects fine from the DataStage server, but when connecting from DataStage client it gives the following error: ...
4
by: alegria4ever | last post by:
I have an Access 2000 database that links several tables from Oracle 9. For some reason or another, one of our user repeatedly gets the following error when accessing queries within this database:...
8
n8kindt
by: n8kindt | last post by:
hi guys, i am also posting this question in the MySQL forum but am putting the detailed post on here. here is the message i am having problems with: ...
2
by: devas | last post by:
Hai, Issue: I am using OEM 10g grid control. I want to establish the connection from oracle to sql server=>I can’t able to connect it. Please help me I have created the system dsn below steps....
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.