<i><b>Originally posted by : Sumesh</b></i><br /><br />Hi, I am calling an Stored Procedure(Select) from an ASP Page. <br /><br />If NO records Exists for the Select Criteria i am Raising Error From stored Procedure using the RAISERROR Method.<br /><br />But this Error is Not Getting Trapped in the Error Object in ASP.Error COllection Shows No Errors<br /><br />My SP as Follows<br /><br />SELECT * FROM Table<br />If @@ROWCOUNT = 0<br />BEGIN<br /> Raiserror('No Record Found',16,1)<br />END
<i><b>Originally posted by : notimportant (jhunt@alagreen.com)</b></i><br />Try @ErrorCode instead.<br />If @ErrorCode = 0<br />Begin<br /> execute @ErrorCode = MyStoredProcedure parm1, param2?lt;br />End<br /><br /><br /><br />------------<br />Sumesh at 4/21/2001 1:07:39 AM<br /><br /><br />Hi, I am calling an Stored Procedure(Select) from an ASP Page. <br /><br />If NO records Exists for the Select Criteria i am Raising Error From stored Procedure using the RAISERROR Method.<br /><br />But this Error is Not Getting Trapped in the Error Object in ASP.Error COllection Shows No Errors<br /><br />My SP as Follows<br /><br />SELECT * FROM Table<br />If @@ROWCOUNT = 0<br />BEGIN<br /> Raiserror('No Record Found',16,1)<br />END
Was this answer helpful ?
Yes No
<i><b>Originally posted by : SUmesh</b></i><br />The Code Given is Not Clear.Can You PLease Elaborate.The Problem is That the Error is Not Getting populated in ASP Error COllection<br /><br /><br />------------<br />notimportant at 4/23/2001 9:57:58 PM<br /><br />Try @ErrorCode instead.<br />If @ErrorCode = 0<br />Begin<br /> execute @ErrorCode = MyStoredProcedure parm1, param2?lt;br />End<br /><br /><br /><br />------------<br />Sumesh at 4/21/2001 1:07:39 AM<br /><br /><br />Hi, I am calling an Stored Procedure(Select) from an ASP Page. <br /><br />If NO records Exists for the Select Criteria i am Raising Error From stored Procedure using the RAISERROR Method.<br /><br />But this Error is Not Getting Trapped in the Error Object in ASP.Error COllection Shows No Errors<br /><br />My SP as Follows<br /><br />SELECT * FROM Table<br />If @@ROWCOUNT = 0<br />BEGIN<br /> Raiserror('No Record Found',16,1)<br />END
Was this answer helpful ?
Yes No
<i><b>Originally posted by : notimportant (jhunt@alagreen.com)</b></i><br />Here is some sample code for what you want<br />if this is not what you are looking for try the url below<br />http://msdn.microsoft.com/workshop/Author/script/msevents.zip<br /><br />Dim lErrNum, sErrSrc, sErrDesc,objRs, objCmd<br />set objRs = Server.CreateObject("ADODB.RecordSet")<br />set objCmd = Server.CreateObject("ADODB.Command")<br />objCmd.ActiveConnection = "usual stuff here"<br />objCmd.CommandText = "myStoredProcedure"<br />objCmd.CommandType = 4<br />Set objRS = objCmd.Execute<br />if objRs.EOF or objRs.BOF then<br />else<br />lErrNum = Err.Number<br />sErrSrc = Err.Source<br />sErrDesc = Err.Description<br />Err.Raise lErrNum, sErrSrc, sErrDesc<br />.....<br />end if<br />
Was this answer helpful ?
Yes No