Solved

err.number = 0

Posted on 2000-04-12
1
1,965 Views
Last Modified: 2012-08-13
I am writing a code and using on error goto errorhandler
and in the errorhandler: I have a msgbox to the err.number. The strange thing is that the program doesn't have any error (or at least I couldn't find any), but still err.number is showing as 0 (zero), with no description. The code basically tries to connect to a SQL server tables through ODBC.
Any one knows about this err.number = 0?
thanks
0
Comment
Question by:khal
1 Comment
 
LVL 1

Accepted Solution

by:
Brian_R earned 100 total points
ID: 2710173
I don't know much about connecting to SQL server, but I always thought that err.number equals zero whenever no error has occured.

One reason you may be getting into your error handler is because you may not have an Exit Sub (to exit Subs) or Exit Function (to Exit Function)

For example, the usual code I have is

Sub Example()
On Error Goto Example_Error

......bunch of code......

Exit Sub

Example_Error:
Msgbox "You have an Error!"
Exit Sub

End Sub

0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

773 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