Solved

err.number = 0

Posted on 2000-04-12
1
1,963 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

11 Experts available now in Live!

Get 1:1 Help Now