Link to home
Start Free TrialLog in
Avatar of MGC22
MGC22

asked on

Tracking any line of code that throws an error.

Is there a way in VB6 to know exactly what line of code errored when the error handling is called?

Does VB track the line it is executing in a variable or something while it is processing. Something like a variable called strCodeExecuting that whenever on error is encountered I can write the variable out and know exactrly the line of code that was trying to be executed?

I want to keep a log of all errors, clients do not always tell me what the actual error was, or all the errors for that matter.

Thanks,
Mike
ASKER CERTIFIED SOLUTION
Avatar of bkthompson2112
bkthompson2112

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of JR2003
JR2003

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MGC22
MGC22

ASKER

I was hoping for the actual text of the line but the line number could work.
As JR2003 mentions about the line numbers, is there a way to automate putting in the line numbers in VB6?
The source code for a vb add-in to add line numbers to code is here:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=49876&lngWId=1
In fact here's a better one and it's freeware!

www.mztools.com 
Thanks :)