Runtime error 0

We are receiving runtime error 0 on some client machines when we deploy a new project for order entry.  The project installs on the client machines and runs fine through several forms until it comes to any form that uses S-grid - a grid control obtained from vbAccelerator.  

Can you please explain what runtime error 0 means so that we can correct our problem?

We are using VB 6 - SP5, Access 2000 and Windows 98.  The project in question is an order entry and inventory system.
patannAsked:
Who is Participating?
 
Anthony PerkinsConnect With a Mentor Commented:
There is no requirement (other than program logic) that you should have an Exit Sub or Exit Function prior to an Error handler.  This is not to say that there should not be one: normally there is, it just does not explain the Err.Number = 0

On the other hand what is probably happening is that an error is raised and the Error object is getting reset prior to displaying the value.  So the clue is in your error handler routine.  If you have something as follows in your error handler:

ErrHandler:
'Do something (for example call a function that logs the error)
Msgbox Err.Number  ' Probably 0

End Sub

Hope this helps,
Anthony
0
 
amebaCommented:
You forgot "Exit Sub" or "Exit Function" before your error handler label.

Sub SomeSub()
    On Orror Go To EH
    ' .... some code
    Exit Sub                    <----- this line is missing

EH:
    MsgBox Err.Description
End Sub
0
 
Éric MoreauSenior .Net ConsultantCommented:
0 is not an error. If err.number <> 0 then you have an error.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Éric MoreauSenior .Net ConsultantCommented:
Can you show some code?
0
 
ianouiiCommented:
or u reset the err.number to 0 & u're handling the error yourself?

try to log down the error to a text file or escalate it out thru a msgbox.

good luck.
0
 
patannAuthor Commented:
Thanks for the help.  I am still working on the problem.

I did check to make sure there is an exit sub or exit function in conjunction with each error handling routine.

Since it works on some machines and not others, I believe the problem may be a Windows dll or ocx that is not loaded and/or registered on the machines where it does not work.

I have not yet had the opportunity to check it out with Norton CrashGuard to narrow the error location.

Thanks again for the help.  If I continue to have a problem, I will post some code for your scrutinity.
0
 
patannAuthor Commented:
We loaded mdac 2.5 on one of the Windows 98 machines that received the error 0, and it seemed to have solved the problem. We had narrowed it down to a Windows file that was missing on the machines having the problem since the exe file on all the machines were the same.  Now I will try loading mdac 2.5 on the other machines also and let you know the results.

By the way below is the code I use for error handling in my code.  The Public sub is in a public module since it is referenced from all the forms in the project.  The first snippet of code is repeated anywhere I trap errors.

ErrorHandler:
    Select Case Err.Number
        Case Else
            Call HandleUnexpectedError(Err.Number, Err.Description)
    End Select
    Resume ExitHere
End Sub

Public Sub HandleUnexpectedError(lngError As Long, strDescription As String)
    MsgBox "Error: " & strDescription & _
    " (" & lngError & ")"
End Sub

Thanks again for your input.  You started me on the right path.
Pat
0
 
amebaCommented:
I'm glad it works - now, you can delete this question since you solved it yourself.
0
 
patannAuthor Commented:
Although the comment did not solve the problem, it pointed me in the right direction to solve it on my own.

Thanks, Pat
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.