[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

err.number = 0

Posted on 2000-04-12
1
Medium Priority
?
1,971 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

650 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