How to handle Error in ASP

A. Using On Error Goto
B. Using On Error Resume
C. Using On Error Resume Next
D. Using On Error Goto 0

Showing Answers 1 - 6 of 6 Answers

kiran

  • May 28th, 2005
 

C . Using On Error Resume Next

Saurabh Gupta

  • Aug 16th, 2005
 

Using on error resume next.

  Was this answer useful?  Yes

Hello,

The option should be A and not C.

The question was hot to handle error in ASP. On Error GOTO <ErrorPath>

The below example records any error occured in the code. Hence the answer for the above question is A.

On Error GoTo DisplayErrorInfo
  cn.Provider = "sas.localprovider.1"
  cn.Properties("Data Source") = "c:\testdata"

  cn.Open
  rs.Open "lostDataset", cn, adOpenDynamic, adLockOptimistic, ADODB.adCmdTableDirect
  rs.Close
  cn.Close

DisplayErrorInfo:
  For Each errorObject In rs.ActiveConnection.Errors
    Debug.Print "Description :"; errorObject.Description
    Debug.Print "Number:"; Hex(errorObject.Number)
  Next

  Was this answer useful?  Yes

shweta

  • Feb 26th, 2007
 

Option A is right answer.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions