?
Solved

err.number = 0

Posted on 2000-04-12
1
Medium Priority
?
1,970 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
[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
1 Comment
 
LVL 1

Accepted Solution

by:
Brian_R earned 400 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

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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