RAISERROR descriptions

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Ivar Svendsen (anonymous_at_discussions.microsoft.com)
Date: 02/29/04


Date: Sun, 29 Feb 2004 06:41:07 -0800

Hello.

I am connecting Access 2002 to a Microsoft SQL 2000 server.
When I try to run a stored procedure that returns errors, I can only read the error codes, and not the description of the error. Here is some example code that I am using:

CREATE PROCEDURE dbo.Test
AS
BEGIN
RAISERROR ( 'Test', 16, 1 )
END

In Access I try to write the following code:

Sub TestError()
On Error Goto HandleError
CurrentProject.Connection.Execute "Test"

HandleError:
For Each ErrObj In CurrentProject.Connection.Errors Do
   Debug.Print ErrObj.Number, ErrObj.Description
Next
End Sub

The output shows the correct error codes, but the description is allways missing.
Could anyone please help me out.

Regards,
Ivar Svendsen



Relevant Pages

  • Re: RAISERROR descriptions
    ... SQL Server Programmer ... > I am connecting Access 2002 to a Microsoft SQL 2000 server. ... the error codes, and not the description of the error. ... > On Error Goto HandleError ...
    (microsoft.public.sqlserver.programming)
  • Re: How to retrieve stored procedure error code in C#?
    ... By generating error codes, do you mean with the RAISEERROR or PRINT ... > I am able to view these error codes when I run the stored proc in Query ... > the stored procedure. ...
    (microsoft.public.dotnet.framework.adonet)
  • How to retrieve stored procedure error code in C#?
    ... My SQL server 2000 stored procedures are generating different error codes. ... I am able to view these error codes when I run the stored proc in Query ... have seen some mention of the stored procedure having to stuff it into a ...
    (microsoft.public.dotnet.framework.adonet)