Error Trapping

TylerTheWimp
09-08-2003, 08:45 AM
Suppose you have a large sub with multiple objects being used. When you use error handling, how can you tell what object generated the error? If, for example, a file system object raises error number 5 for a disconnected network drive but your winsock object also raises error number 5 if a hamster has clogged your port...how do you know which object raised error #5?

Ty

Jared
09-08-2003, 09:29 AM
Suppose you have a large sub with multiple objects being used. When you use error handling, how can you tell what object generated the error? If, for example, a file system object raises error number 5 for a disconnected network drive but your winsock object also raises error number 5 if a hamster has clogged your port...how do you know which object raised error #5?

Ty

When an object raises an error it should set the "Source" property of the error object. So for example when Winsock raises an error if you look at Err.Source you will see that it equals "Winsock".

Jared Hoylman
http://jhsys.8k.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum