×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Returning values from MTS to an ASP

Returning values from MTS to an ASP

Returning values from MTS to an ASP

(OP)
Hi

Don't know if its just me being a bit silly but I have a  component which is invoked by an ASP, does some DB, DCOM stuff etc. and then returns a value (string) to the ASP page for display.

The problem is, I'm unit testing this component and passing it invalid input to make it error and test my error routines. What should happen, and does when I run in debug mode, is that the component enters my error handler and returns a string msg. However, when I run the component without debug, the component returns nothing.

Can anyone tell me what I'm doing wrong!!!???

Thanks

C

RE: Returning values from MTS to an ASP

How do you have the project properties set: "Break on all errors"?

Chip H.

RE: Returning values from MTS to an ASP

(OP)
Chip

Thanks for the reply but I'm not sure I understand the question, could you elaborate please..!

Cheers

Chris

RE: Returning values from MTS to an ASP

I guess run in debug mode means that you are running the project in design mode (pressing F5 or play).
Not running the project in debug mode means you`ve compiled it.
Do you have an On Error statement in your errorhandler. If you consider the code below you would think the msgbox would say 55 but it will give 0 as if no error ocurred:
On Error GoTo arr
Err.Raise 55

arr:
On Error GoTo 0
MsgBox Err.Number

Anyway returning the error to the asp page will not happen because the error number is 0.
If you pass the response object when you call the com component you can let the component write the error for you like so:
(set a ref to the com component from asp)
dim objMyComponent
set objMyComponent = server.createobject("myproject.myclass")
objMyComponent.myPublicSub Response

(in the com component set a reference to Microsoft Active Server Pages Object Library)
public sub myPublicSup(objMyResponse As Response)
err.raise 55

arr:
objMyResponse.write "Sorry an error ocured " & err.description & "<br>Error code: " & err.number

If you run your component in MTS you can set the ObjectContext and you do not need to pass the response from asp to the com component.
I can explain how to do it if you need it but not now.

Hope this helps a little and good luck.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close