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
Solved

err.number = 0

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

789 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