Solved

Runtime error 0

Posted on 2001-06-19
9
1,680 Views
Last Modified: 2012-08-14
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.
0
Comment
Question by:patann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 15

Expert Comment

by:ameba
ID: 6208362
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6208637
0 is not an error. If err.number <> 0 then you have an error.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6208640
Can you show some code?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ianouii
ID: 6208940
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
 

Author Comment

by:patann
ID: 6211174
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
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 200 total points
ID: 6212015
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
 

Author Comment

by:patann
ID: 6215837
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
 
LVL 15

Expert Comment

by:ameba
ID: 6215864
I'm glad it works - now, you can delete this question since you solved it yourself.
0
 

Author Comment

by:patann
ID: 6216212
Although the comment did not solve the problem, it pointed me in the right direction to solve it on my own.

Thanks, Pat
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question