Solved

Runtime error 0

Posted on 2001-06-19
9
1,569 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
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 15

Expert Comment

by:ameba
Comment Utility
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 69

Expert Comment

by:Éric Moreau
Comment Utility
0 is not an error. If err.number <> 0 then you have an error.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Can you show some code?
0
 
LVL 5

Expert Comment

by:ianouii
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:patann
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I'm glad it works - now, you can delete this question since you solved it yourself.
0
 

Author Comment

by:patann
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now