Displaying an @@error in an asp page

Discussion in 'ASP General' started by Peter Rooney, Jan 8, 2004.

  1. Peter Rooney

    Peter Rooney Guest

    Hi,

    I am trying to display an error from a Stored Procedure in an asp page,
    below is the procedure and how I am trying to call it from the asp page,
    any help on what I am doing wrong would be great.

    CREATE PROCEDURE dbo.cnms_employee_dir_new

    @NETWORK_ID VARCHAR(3),
    @CORP_ID VARCHAR(10),
    @EMP_ID VARCHAR(10),
    @DIR_ID VARCHAR(10),
    @DIR_SEC_EMP_ID VARCHAR(10) = NULL,
    @DIR_GROUP_CODE VARCHAR(4)= NULL,
    @DIR_USER_1 VARCHAR(60)= NULL,
    @DIR_USER_2 VARCHAR(60)= NULL,
    @DIR_USER_3 VARCHAR(60)= NULL,
    @DIR_USER_4 VARCHAR(60)= NULL,
    @DIR_EMP_NICKNAME VARCHAR(32)= NULL,
    @DIR_SECURITY_LEVEL VARCHAR(1)= NULL,
    @DIR_EX_PAPER_DIR VARCHAR(1)= NULL,
    @DIR_EX_ONLINE_DIR VARCHAR(1)= NULL,
    @NODE_ID VARCHAR(5)= NULL,
    @DIR_CIL_ID VARCHAR(20)= NULL,
    @LOCATION_ID VARCHAR(10)= NULL,
    @DIR_DIAL_CODE VARCHAR(10)= NULL,
    @DIR_DDI_NUMBER VARCHAR(12)= NULL,
    @DIR_FLAGS VARCHAR(10)= NULL,

    @START_DATE DATETIME,
    @END_DATE DATETIME= NULL



    AS
    BEGIN


    INSERT Directory
    (
    NETWORK_ID,
    CORP_ID,
    EMP_ID,
    DIR_ID,
    DIR_SEC_EMP_ID,
    DIR_GROUP_CODE,
    DIR_USER_1,
    DIR_USER_2,
    DIR_USER_3,
    DIR_USER_4,
    DIR_EMP_NICKNAME,
    DIR_SECURITY_LEVEL,
    DIR_EX_PAPER_DIR,
    DIR_EX_ONLINE_DIR,
    NODE_ID,
    DIR_CIL_ID,
    LOCATION_ID,
    DIR_DIAL_CODE,
    DIR_DDI_NUMBER,
    DIR_FLAGS,
    START_DATE,
    END_DATE


    )
    VALUES
    (
    @NETWORK_ID,
    @CORP_ID,
    @EMP_ID,
    @DIR_ID,
    @DIR_SEC_EMP_ID,
    @DIR_GROUP_CODE,
    @DIR_USER_1,
    @DIR_USER_2,
    @DIR_USER_3,
    @DIR_USER_4,
    @DIR_EMP_NICKNAME,
    @DIR_SECURITY_LEVEL,
    @DIR_EX_PAPER_DIR,
    @DIR_EX_ONLINE_DIR,
    @NODE_ID,
    @DIR_CIL_ID,
    @LOCATION_ID,
    @DIR_DIAL_CODE,
    @DIR_DDI_NUMBER,
    @DIR_FLAGS,
    @START_DATE,
    @END_DATE
    )
    IF @@ERROR<>0
    BEGIN
    SELECT 'WRONG SEC'
    END



    END
    GO

    ===========================================

    objRS = Conn.Execute (szSQL)

    if objRS(0) = "WRONG SEC" Then
    SEC_ERROR = 1
    end if

    =============================================

    Thanks for any help


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Peter Rooney, Jan 8, 2004
    #1
    1. Advertising

  2. Peter Rooney

    Bob Barrows Guest

    Peter Rooney wrote:
    > Hi,
    >
    > I am trying to display an error from a Stored Procedure in an asp
    > page, below is the procedure and how I am trying to call it from the
    > asp page, any help on what I am doing wrong would be great.


    http://support.microsoft.com/default.aspx?scid=kb;EN-US;194792
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;231985
    http://support.microsoft.com/default.aspx?scid=kb;en-us;254304&Product=ado

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows, Jan 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BoltonWolf

    Displaying a aspx page within a page

    BoltonWolf, Feb 23, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    454
  2. ashutosh
    Replies:
    1
    Views:
    3,388
    kaeli
    May 27, 2005
  3. =?Utf-8?B?TWF0dE0=?=

    Displaying ASP page in ASPX page

    =?Utf-8?B?TWF0dE0=?=, Feb 16, 2007, in forum: ASP .Net
    Replies:
    9
    Views:
    1,280
    =?Utf-8?B?TWF0dE0=?=
    Feb 19, 2007
  4. Bishop
    Replies:
    1
    Views:
    828
    Bishop
    Feb 24, 2007
  5. Guest
    Replies:
    1
    Views:
    126
    Ray at
    Oct 24, 2003
Loading...

Share This Page