Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected Error 50003 - This is a good one! 1

Status
Not open for further replies.

ChristoM

Programmer
May 21, 2002
3
GB

This is the problem explained in some detail below:

I run a VB 5 exe on a Citrix server (NT) which is accessed by the user via thin client technology. I have the source code on my laptop (Win98) which is where i do all my developing of code, I also compile the code on my laptop and then update the server with the new exe as and when needed.

The problem i am having is recently, when i amend code and compile the exe on my laptop and then copy it over to the server - the exe runs fine but certain forms within the application when attempted to be accessed throws up the error below which is then handled appropriately within my code (ie chucks me out to main MDI form without causing a fatal error):

50003: Unexpected Error

The thing that really gets me is that if I point the ODBC connection on my Laptop to the live d/base and run the exe on my Laptop everything runs perfectly and all forms can be accessed! So i can't even re-create the error on test in order to debug it thoroughly ......... Another thing as well - if i revert back to a previous exe the forms within the application which cause the error, open perfectly with no errors on the server - help!

The only thing which has changed over the last few months is that our company has changed from a Novell network to a MS exchange network, so I have a sneaking suspicion it is a Dll, Ocx version problem between the server and my laptop??

Thanks in advance, Chris
 
I can't help, but I just love the phrase 'Unexpected Error'. The implication is that errors which don't say they're UNEXpected, must therefore be EXpected!

Mind you, someone said that if Debugging is the art of taking errors OUT of code, then Programming must be the art of putting them IN! Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
Chris,

It sounds like your error handling is not good enough to identify the line of code causing the error. This makes it very difficult to resolve problems which cannot be reproduced in a test environment. When an error is encountered you need to store the error line number (erl) as well as the routine name, so that this information can be logged or displayed. Of course you also need to ensure that all lines are uniquely numbered so that erl contains something useful.

Jim,
Regarding the phrase "unexpected error", I agree this sounds like a tautology, but it is not really. VB can raise errors in situations which are expected e.g. when a file is missing. These are "expected errors" and should be handled by specific code. Any other errors are "unexpected errors" and should be handled by an appropriate generic error handling mechanism.

Glyn.
 
This is all I could find:
Is there a gif on your form ->
Is there a reference to a control or com component that is missing or (more probebly) of an older version?

Looking on the MS site I can see that they use this if an error occured that they cannot explain (did not expect when they made the sollution) and is quickly referred to as a BUG.

Did you change the MDAC on the NT machine / are they the same as on your laptop?

This is for GlynA:

How do you get a line number when an error occures??
 
harmmeijer,

Whenever an error is raised the variable erl contains the line number. This is not very well documented by Microsoft. This is probably because they view line numbers as archaic.

Glyn.
 
Thanks again

I've found a program which compares all dlls/ocx's for a specified exe on two separate machines and it shows that some dlls which the exe references are different on the NT server than my on laptop (NT has older dlls) - i'll try and bring them in line to see if this has any effect ...
 
Ha ha ha ha ha ha ha ha ha ha GREAAAT!!!!!!!

Private Sub Form_Load()
1 Dim somevar As Integer
2 On Error GoTo errhand
3 somevar = 22
4 MsgBox somevar / 0

Exit Sub
errhand:
MsgBox "The error occured in line: " & Erl
End Sub

I will extually get 4 star 4 you Glyn.

Two more questions:

1. Is there a setting in VB that makes the
line numbers for you? I have never worked
with the line numbers (exept on the commadore).
2. Should I remove the line numbers when the app
goes into production?
 
HI Chris,

It's not a joke. Try to change you Color resolution setting
in the "Display Properties" to 16 Bits or less.

I add the same problem on WIN98 because the color setting were 32 Bits. I changed it to 16 Bits and all my forms were able to load whit no "Unexpected Error 50003".

Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top