Trapping COM errors in ASP

Results 1 to 3 of 3

Thread: Trapping COM errors in ASP

  1. #1
    BMonday Guest

    Default Trapping COM errors in ASP

    Hi,<BR><BR>I have the desire to trap, and act upon, errors returned by a COM object written in C. The way I do it in VB is not working in VBScript. Is there a resource I can go to that will show me the best way of doing this?<BR><BR>Thanks in advance,<BR>Beau

  2. #2
    Join Date
    Dec 1969

    Default RE: Trapping COM errors in ASP

    All you can currently do by way of error handling in VBScript is:<BR><BR>On Error Resume Next<BR>... &#039 operations that may throw errors<BR>If Err.number &#060;&#062; 0 Then &#039error occured<BR>... &#039 handle error here<BR>End If<BR>On Error Goto 0 &#039 cancel resume next<BR><BR>Pretty lousy, huh?<BR><BR>Dunc

  3. #3
    Rafeeq Guest

    Default RE: Trapping COM errors in ASP

    Well this is a kind of situation in which every Com developer finds himself! Error handling in VB Script just shucks! All you have is On error Resume next instead of the bunch of features as in VB. And if you got to trap the COM related errors then you had it. The best way to go about is to use the eventViewer on Win NT machine. All you gotta do is include this line of code in the event handler of your component:<BR>App.LogEvent Err.Number & " " & Err.Source & " " & Err.Description.<BR>This ensures that whenever the application encounters an error cuz of a COM object, a log will be generated and thus you can nail the error!<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts