SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 21st, 2001, 03:07 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Error Handling

<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

Reply With Quote
  #2  
Old April 23rd, 2001, 11:57 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<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…<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

Reply With Quote
  #3  
Old May 7th, 2001, 09:11 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<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…<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

Reply With Quote
  #4  
Old May 8th, 2001, 01:02 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<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 />

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Error Handling


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT