Displaying an @@error in an asp page

P

Peter Rooney

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top